31 lines
678 B
JavaScript
31 lines
678 B
JavaScript
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import path from 'path';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
base: "./",
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
build: {
|
|
// 确保外部依赖被正确打包
|
|
rollupOptions: {
|
|
external: [],
|
|
output: {
|
|
// 确保tree-kill等Node.js依赖被正确打包
|
|
manualChunks: undefined,
|
|
},
|
|
},
|
|
// 复制public目录中的文件到dist目录
|
|
assetsDir: "assets",
|
|
// 确保所有依赖都被打包
|
|
commonjsOptions: {
|
|
include: [/node_modules/],
|
|
},
|
|
},
|
|
});
|