Commit 71f5334828fc68764cc40d3683b146c9c7f81514
1 parent
440a870f
打包删调试信息设置
Showing
2 changed files
with
8 additions
and
1 deletions
src/main.ts
| @@ -5,7 +5,7 @@ import promise from 'es6-promise' | @@ -5,7 +5,7 @@ import promise from 'es6-promise' | ||
| 5 | // import store from '@/store/index' | 5 | // import store from '@/store/index' |
| 6 | 6 | ||
| 7 | import ElementPlus from 'element-plus' | 7 | import ElementPlus from 'element-plus' |
| 8 | -import { ElMessage,ElMessageBox } from 'element-plus' | 8 | +import { ElMessage, ElMessageBox } from 'element-plus' |
| 9 | import 'element-plus/dist/index.css' | 9 | import 'element-plus/dist/index.css' |
| 10 | import zhCn from 'element-plus/es/locale/lang/zh-cn' // TIP elementUI配置中文环境 | 10 | import zhCn from 'element-plus/es/locale/lang/zh-cn' // TIP elementUI配置中文环境 |
| 11 | 11 |
vite.config.ts
| @@ -76,6 +76,13 @@ export default ({command, mode}) => { | @@ -76,6 +76,13 @@ export default ({command, mode}) => { | ||
| 76 | // 'vue': ['vue'], | 76 | // 'vue': ['vue'], |
| 77 | // } | 77 | // } |
| 78 | } | 78 | } |
| 79 | + }, | ||
| 80 | + // TIP 正式环境删除console和debugger | ||
| 81 | + terserOptions: { | ||
| 82 | + compress: { | ||
| 83 | + drop_console: mode === 'production'? true: false, | ||
| 84 | + drop_debugger: mode === 'production'? true: false | ||
| 85 | + } | ||
| 79 | } | 86 | } |
| 80 | }, | 87 | }, |
| 81 | }) | 88 | }) |