打包去log不生效处理
parent
e687fa784f
commit
e23d82dedb
|
@ -7,9 +7,6 @@ VITE_PUBLIC_PATH = /
|
||||||
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
||||||
VITE_PROXY = [["/jeecgboot","http://localhost:8080/jeecg-boot"],["/upload","http://localhost:3300/upload"]]
|
VITE_PROXY = [["/jeecgboot","http://localhost:8080/jeecg-boot"],["/upload","http://localhost:3300/upload"]]
|
||||||
|
|
||||||
# 控制台不输出
|
|
||||||
VITE_DROP_CONSOLE = false
|
|
||||||
|
|
||||||
#后台接口父地址(必填)
|
#后台接口父地址(必填)
|
||||||
VITE_GLOB_API_URL=/jeecgboot
|
VITE_GLOB_API_URL=/jeecgboot
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,6 @@ VITE_USE_MOCK = true
|
||||||
# 发布路径
|
# 发布路径
|
||||||
VITE_PUBLIC_PATH = /
|
VITE_PUBLIC_PATH = /
|
||||||
|
|
||||||
# 控制台不输出
|
|
||||||
VITE_DROP_CONSOLE = true
|
|
||||||
|
|
||||||
# 是否启用gzip或brotli压缩
|
# 是否启用gzip或brotli压缩
|
||||||
# 选项值: gzip | brotli | none
|
# 选项值: gzip | brotli | none
|
||||||
# 如果需要多个可以使用“,”分隔
|
# 如果需要多个可以使用“,”分隔
|
||||||
|
|
|
@ -27,7 +27,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||||
// The boolean type read by loadEnv is a string. This function can be converted to boolean type
|
// The boolean type read by loadEnv is a string. This function can be converted to boolean type
|
||||||
const viteEnv = wrapperEnv(env);
|
const viteEnv = wrapperEnv(env);
|
||||||
|
|
||||||
const { VITE_PORT, VITE_PUBLIC_PATH, VITE_PROXY, VITE_DROP_CONSOLE } = viteEnv;
|
const { VITE_PORT, VITE_PUBLIC_PATH, VITE_PROXY } = viteEnv;
|
||||||
|
|
||||||
const isBuild = command === 'build';
|
const isBuild = command === 'build';
|
||||||
|
|
||||||
|
@ -65,18 +65,15 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||||
target: 'es2015',
|
target: 'es2015',
|
||||||
cssTarget: 'chrome80',
|
cssTarget: 'chrome80',
|
||||||
outDir: OUTPUT_DIR,
|
outDir: OUTPUT_DIR,
|
||||||
terserOptions: {
|
// 关闭brotliSize显示可以稍微减少打包时间
|
||||||
compress: {
|
|
||||||
keep_infinity: true,
|
|
||||||
// Used to delete console in production environment
|
|
||||||
drop_console: VITE_DROP_CONSOLE,
|
|
||||||
drop_debugger: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// Turning off brotliSize display can slightly reduce packaging time
|
|
||||||
reportCompressedSize: false,
|
reportCompressedSize: false,
|
||||||
|
// 提高超大静态资源警告大小
|
||||||
chunkSizeWarningLimit: 2000,
|
chunkSizeWarningLimit: 2000,
|
||||||
},
|
},
|
||||||
|
esbuild: {
|
||||||
|
//清除全局的console.log和debug
|
||||||
|
drop: isBuild ? ['console', 'debugger'] : [],
|
||||||
|
},
|
||||||
define: {
|
define: {
|
||||||
// setting vue-i18-next
|
// setting vue-i18-next
|
||||||
// Suppress warning
|
// Suppress warning
|
||||||
|
|
Loading…
Reference in New Issue