mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-20 10:59:21 +08:00
fix: debugger 语句在开发环境下不生效 (#170)
Co-authored-by: pany <939630029@qq.com>
This commit is contained in:
parent
893ad57f7c
commit
bf17c67fda
@ -9,8 +9,8 @@ import svgLoader from "vite-svg-loader"
|
||||
import UnoCSS from "unocss/vite"
|
||||
|
||||
/** 配置项文档:https://cn.vitejs.dev/config */
|
||||
export default (configEnv: ConfigEnv): UserConfigExport => {
|
||||
const viteEnv = loadEnv(configEnv.mode, process.cwd()) as ImportMetaEnv
|
||||
export default ({ mode }: ConfigEnv): UserConfigExport => {
|
||||
const viteEnv = loadEnv(mode, process.cwd()) as ImportMetaEnv
|
||||
const { VITE_PUBLIC_PATH } = viteEnv
|
||||
return {
|
||||
/** 打包时根据实际情况修改 base */
|
||||
@ -69,14 +69,17 @@ export default (configEnv: ConfigEnv): UserConfigExport => {
|
||||
}
|
||||
},
|
||||
/** 混淆器 */
|
||||
esbuild: {
|
||||
/** 打包时移除 console.log */
|
||||
pure: ["console.log"],
|
||||
/** 打包时移除 debugger */
|
||||
drop: ["debugger"],
|
||||
/** 打包时移除所有注释 */
|
||||
legalComments: "none"
|
||||
},
|
||||
esbuild:
|
||||
mode === "development"
|
||||
? undefined
|
||||
: {
|
||||
/** 打包时移除 console.log */
|
||||
pure: ["console.log"],
|
||||
/** 打包时移除 debugger */
|
||||
drop: ["debugger"],
|
||||
/** 打包时移除所有注释 */
|
||||
legalComments: "none"
|
||||
},
|
||||
/** Vite 插件 */
|
||||
plugins: [
|
||||
vue(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user