加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts.js 7.37 KB
一键复制 编辑 原始数据 按行查看 历史
Jpabon 提交于 2023-11-12 13:25 . Se termina traduccion
// vite.config.ts
import { rmSync } from "fs";
import { join } from "path";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import electron from "vite-plugin-electron";
// package.json
var package_default = {
name: "tts-vue",
version: "1.9.15",
main: "dist/electron/main/index.js",
description: "\u{1F3A4} \u5FAE\u8F6F\u8BED\u97F3\u5408\u6210\u5DE5\u5177\uFF0C\u4F7F\u7528 Electron + Vue + ElementPlus + Vite \u6784\u5EFA\u3002",
author: "\u6CAB\u96E2Loker <loker80@qq.com>",
license: "MIT",
private: true,
type: "module",
scripts: {
dev: "vite",
build: "vue-tsc --noEmit && vite build && electron-builder"
},
engines: {
node: ">=14.17.0"
},
devDependencies: {
"@vitejs/plugin-vue": "^2.3.3",
electron: "^19.1.9",
"electron-builder": "^23.1.0",
typescript: "^4.7.4",
vite: "^2.9.13",
"vite-plugin-electron": "^0.8.1",
vue: "^3.2.37",
"vue-tsc": "^0.38.3"
},
env: {
VITE_DEV_SERVER_HOST: "127.0.0.1",
VITE_DEV_SERVER_PORT: 3344
},
keywords: [
"electron",
"rollup",
"vite",
"vue3",
"vue"
],
dependencies: {
"@types/ws": "^8.5.4",
axios: "^0.27.2",
"electron-log": "^4.4.8",
"electron-store": "^8.0.2",
"element-plus": "2.2.9",
"microsoft-cognitiveservices-speech-sdk": "^1.30.1",
"nodejs-websocket": "^1.7.2",
pinia: "^2.0.17",
uuid: "^8.3.2",
"vue-i18n": "^9.6.5",
ws: "^8.13.0"
}
};
// vite.config.ts
rmSync("dist", { recursive: true, force: true });
var vite_config_default = defineConfig({
resolve: {
alias: {
"@": join("D:\\xampp\\htdocs\\Transformes\\tts-vue", "./src"),
"@components": join("D:\\xampp\\htdocs\\Transformes\\tts-vue", "./src/components")
}
},
plugins: [
vue(),
electron({
main: {
entry: "electron/main/index.ts",
vite: withDebug({
build: {
outDir: "dist/electron/main"
}
})
},
preload: {
input: {
index: join("D:\\xampp\\htdocs\\Transformes\\tts-vue", "electron/preload/index.ts")
},
vite: {
build: {
sourcemap: "inline",
outDir: "dist/electron/preload"
}
}
},
renderer: {}
})
],
server: {
host: package_default.env.VITE_DEV_SERVER_HOST,
port: package_default.env.VITE_DEV_SERVER_PORT
}
});
function withDebug(config) {
if (process.env.VSCODE_DEBUG) {
if (!config.build)
config.build = {};
config.build.sourcemap = true;
config.plugins = (config.plugins || []).concat({
name: "electron-vite-debug",
configResolved(config2) {
const index = config2.plugins.findIndex(
(p) => p.name === "electron-main-watcher"
);
config2.plugins.splice(index, 1);
}
});
}
return config;
}
export {
vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB7IHJtU3luYyB9IGZyb20gXCJmc1wiO1xyXG5pbXBvcnQgeyBqb2luIH0gZnJvbSBcInBhdGhcIjtcclxuaW1wb3J0IHsgZGVmaW5lQ29uZmlnLCBQbHVnaW4sIFVzZXJDb25maWcgfSBmcm9tIFwidml0ZVwiO1xyXG5pbXBvcnQgdnVlIGZyb20gXCJAdml0ZWpzL3BsdWdpbi12dWVcIjtcclxuaW1wb3J0IGVsZWN0cm9uIGZyb20gXCJ2aXRlLXBsdWdpbi1lbGVjdHJvblwiO1xyXG5pbXBvcnQgcGtnIGZyb20gXCIuL3BhY2thZ2UuanNvblwiO1xyXG5cclxucm1TeW5jKFwiZGlzdFwiLCB7IHJlY3Vyc2l2ZTogdHJ1ZSwgZm9yY2U6IHRydWUgfSk7IC8vIHYxNC4xNC4wXHJcblxyXG4vLyBodHRwczovL3ZpdGVqcy5kZXYvY29uZmlnL1xyXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoe1xyX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