This commit is contained in:
2025-10-17 14:37:48 +08:00
parent fe1ae0ccdf
commit 9e57d52769
12 changed files with 57 additions and 2443 deletions

View File

@@ -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: {