Commit dac2f8f2 authored by sven's avatar sven

11

parent e719bb73
/.idea
/*.exe
/*.gz
/cache
*.tmp
/main
/vendor
/.vscode
*.tar
.idea/
/web/node_modules
/web/dist
.DS_Store
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
/server/log/
/server/gva
/server/latest_log
/server/*.exe
*.iml
......@@ -8,9 +8,9 @@ import * as fs from 'fs'
import vuePlugin from '@vitejs/plugin-vue'
// @see https://cn.vitejs.dev/config/
export default ({
command,
mode
}) => {
command,
mode
}) => {
const NODE_ENV = process.env.NODE_ENV || 'development'
const envFiles = [
`.env.${NODE_ENV}`
......@@ -26,18 +26,13 @@ export default ({
const timestamp = Date.parse(new Date())
const rollupOptions = {
output: {
entryFileNames: `gva/gin-vue-admin-[name].${timestamp}.js`,
chunkFileNames: `js/gin-vue-admin-[name].${timestamp}.js`,
assetFileNames: `assets/gin-vue-admin-[name].${timestamp}.[ext]`,
manualChunks(id) {
if (id.includes('node_modules')) {
return id.toString().split('node_modules/')[1].split('/')[0].toString();
}
}
}
}
// const rollupOptions = {
// output: {
// entryFileNames: `gva/gin-vue-admin-[name].${timestamp}.js`,
// chunkFileNames: `js/gin-vue-admin-[name].${timestamp}.js`,
// assetFileNames: `assets/gin-vue-admin-[name].${timestamp}.[ext]`
// }
// }
const optimizeDeps = {}
......@@ -72,13 +67,12 @@ export default ({
},
},
build: {
target: 'es2015',
target: 'es2017',
minify: 'terser', // 是否进行压缩,boolean | 'terser' | 'esbuild',默认使用terser
manifest: false, // 是否产出manifest.json
sourcemap: false, // 是否产出sourcemap.json
outDir: 'dist', // 产出目录
chunkSizeWarningLimit:1500,
rollupOptions,
// rollupOptions,
},
esbuild,
optimizeDeps,
......@@ -96,4 +90,4 @@ export default ({
}
},
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment