Commit dac2f8f2 authored by sven's avatar sven

11

parent e719bb73
/.idea .idea/
/*.exe /web/node_modules
/*.gz /web/dist
/cache
*.tmp .DS_Store
/main
/vendor # local env files
/.vscode .env.local
*.tar .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' ...@@ -8,9 +8,9 @@ import * as fs from 'fs'
import vuePlugin from '@vitejs/plugin-vue' import vuePlugin from '@vitejs/plugin-vue'
// @see https://cn.vitejs.dev/config/ // @see https://cn.vitejs.dev/config/
export default ({ export default ({
command, command,
mode mode
}) => { }) => {
const NODE_ENV = process.env.NODE_ENV || 'development' const NODE_ENV = process.env.NODE_ENV || 'development'
const envFiles = [ const envFiles = [
`.env.${NODE_ENV}` `.env.${NODE_ENV}`
...@@ -26,18 +26,13 @@ export default ({ ...@@ -26,18 +26,13 @@ export default ({
const timestamp = Date.parse(new Date()) const timestamp = Date.parse(new Date())
const rollupOptions = { // const rollupOptions = {
output: { // output: {
entryFileNames: `gva/gin-vue-admin-[name].${timestamp}.js`, // entryFileNames: `gva/gin-vue-admin-[name].${timestamp}.js`,
chunkFileNames: `js/gin-vue-admin-[name].${timestamp}.js`, // chunkFileNames: `js/gin-vue-admin-[name].${timestamp}.js`,
assetFileNames: `assets/gin-vue-admin-[name].${timestamp}.[ext]`, // 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 optimizeDeps = {} const optimizeDeps = {}
...@@ -72,13 +67,12 @@ export default ({ ...@@ -72,13 +67,12 @@ export default ({
}, },
}, },
build: { build: {
target: 'es2015', target: 'es2017',
minify: 'terser', // 是否进行压缩,boolean | 'terser' | 'esbuild',默认使用terser minify: 'terser', // 是否进行压缩,boolean | 'terser' | 'esbuild',默认使用terser
manifest: false, // 是否产出manifest.json manifest: false, // 是否产出manifest.json
sourcemap: false, // 是否产出sourcemap.json sourcemap: false, // 是否产出sourcemap.json
outDir: 'dist', // 产出目录 outDir: 'dist', // 产出目录
chunkSizeWarningLimit:1500, // rollupOptions,
rollupOptions,
}, },
esbuild, esbuild,
optimizeDeps, optimizeDeps,
...@@ -96,4 +90,4 @@ export default ({ ...@@ -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