update vite.config.js
This commit is contained in:
parent
3712f01a36
commit
7db2a56a87
@ -18,14 +18,15 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
// https://cn.vitejs.dev/config/#resolve-extensions
|
// https://cn.vitejs.dev/config/#resolve-extensions
|
||||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
|
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
|
||||||
},
|
},
|
||||||
|
css: {
|
||||||
|
devSourcemap: true //开发模式时启用
|
||||||
|
},
|
||||||
base: env.VITE_APP_ROUTER_PREFIX,
|
base: env.VITE_APP_ROUTER_PREFIX,
|
||||||
// 打包配置
|
// 打包配置
|
||||||
build: {
|
build: {
|
||||||
sourcemap: command === 'build' ? false : true,
|
sourcemap: command === 'build' ? false : true,
|
||||||
target: 'modules',
|
|
||||||
outDir: 'dist', //指定输出目录
|
outDir: 'dist', //指定输出目录
|
||||||
assetsDir: 'assets', //指定静态资源存储目录
|
assetsDir: 'assets', //指定静态资源存储目录(相对于outDir)
|
||||||
minify: 'terser', //混淆器,terser构建后文件体积更小
|
|
||||||
},
|
},
|
||||||
// vite 相关配置
|
// vite 相关配置
|
||||||
server: {
|
server: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user