Merge branch 'master' of http://gitea.sczysoft.com/ganzi/daofu-large-screen
This commit is contained in:
commit
a6bf5bf62b
|
|
@ -3,3 +3,8 @@
|
|||
VITE_TITLE = 道孚县鲜水镇“智慧鲜水”数字化平台
|
||||
|
||||
VITE_PUBLIC_PATH = /
|
||||
|
||||
# 是否在打包时生成 sourcemap
|
||||
VITE_BUILD_SOURCEMAP = false
|
||||
# 是否在打包时删除 console 代码
|
||||
VITE_BUILD_DROP_CONSOLE = true
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -23,7 +23,7 @@ const root: string = process.cwd();
|
|||
|
||||
// https://vitejs.dev/config/
|
||||
export default ({ command, mode }: ConfigEnv): UserConfigExport => {
|
||||
const { VITE_PORT, VITE_PUBLIC_PATH, VITE_PROXY, VITE_TITLE } = wrapperEnv(
|
||||
const { VITE_PORT, VITE_PUBLIC_PATH, VITE_PROXY, VITE_TITLE, VITE_BUILD_DROP_CONSOLE } = wrapperEnv(
|
||||
loadEnv(mode, root)
|
||||
);
|
||||
// 获取 .env 文件里定义的环境变量
|
||||
|
|
@ -77,10 +77,11 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
|
|||
buildTime: new Date()
|
||||
},
|
||||
build: {
|
||||
minify: 'terser',
|
||||
target: "es2020",
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: true, // 在生产环境移除console.log
|
||||
drop_console: VITE_BUILD_DROP_CONSOLE, // 在生产环境移除console.log
|
||||
drop_debugger: true // 在生产环境移除debugger
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user