fix
This commit is contained in:
@@ -22,6 +22,7 @@ function createIIFEConfig(platform: 'desktop' | 'mobile'): UserConfig {
|
||||
global: 'window',
|
||||
},
|
||||
build: {
|
||||
target: 'es2022',
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, `src/js/${platform}.ts`),
|
||||
name: `${packageJson.name.replaceAll('-', '_')}_${platform}_iife`,
|
||||
@@ -38,7 +39,7 @@ function createIIFEConfig(platform: 'desktop' | 'mobile'): UserConfig {
|
||||
},
|
||||
outDir: path.resolve(__dirname, `dist-iife/${platform}`), // 输出到 dist-iife 目录
|
||||
sourcemap: isProd ? false : 'inline', // 生产环境关闭,开发环境使用 inline
|
||||
minify: isProd ? 'terser' : false, // 生产环境使用 terser 混淆,开发环境不混淆
|
||||
minify: 'terser', // 强制进行混淆,避免全局变量被污染的问题
|
||||
...(isProd && {
|
||||
terserOptions: {
|
||||
compress: {
|
||||
|
||||
Reference in New Issue
Block a user