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"
|
import UnoCSS from "unocss/vite"
|
||||||
|
|
||||||
/** 配置项文档:https://cn.vitejs.dev/config */
|
/** 配置项文档:https://cn.vitejs.dev/config */
|
||||||
export default (configEnv: ConfigEnv): UserConfigExport => {
|
export default ({ mode }: ConfigEnv): UserConfigExport => {
|
||||||
const viteEnv = loadEnv(configEnv.mode, process.cwd()) as ImportMetaEnv
|
const viteEnv = loadEnv(mode, process.cwd()) as ImportMetaEnv
|
||||||
const { VITE_PUBLIC_PATH } = viteEnv
|
const { VITE_PUBLIC_PATH } = viteEnv
|
||||||
return {
|
return {
|
||||||
/** 打包时根据实际情况修改 base */
|
/** 打包时根据实际情况修改 base */
|
||||||
@ -69,14 +69,17 @@ export default (configEnv: ConfigEnv): UserConfigExport => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 混淆器 */
|
/** 混淆器 */
|
||||||
esbuild: {
|
esbuild:
|
||||||
/** 打包时移除 console.log */
|
mode === "development"
|
||||||
pure: ["console.log"],
|
? undefined
|
||||||
/** 打包时移除 debugger */
|
: {
|
||||||
drop: ["debugger"],
|
/** 打包时移除 console.log */
|
||||||
/** 打包时移除所有注释 */
|
pure: ["console.log"],
|
||||||
legalComments: "none"
|
/** 打包时移除 debugger */
|
||||||
},
|
drop: ["debugger"],
|
||||||
|
/** 打包时移除所有注释 */
|
||||||
|
legalComments: "none"
|
||||||
|
},
|
||||||
/** Vite 插件 */
|
/** Vite 插件 */
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user