Skip to content

Commit decac63

Browse files
committed
fix: production environment cancellation execution
1 parent aebf93c commit decac63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = options =>
1111
// return id.endsWith('main.ts')
1212
// },
1313
webpack(compiler) {
14+
if (compiler.options.mode === 'production')
15+
return
1416
const alias = compiler.options?.resolve?.alias
1517
const aliasList: AliasOptions & Alias[] = Object.keys(alias ?? {}).map(k => ({
1618
find: k,
@@ -20,6 +22,8 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = options =>
2022
},
2123
vite: {
2224
configResolved(config: ResolvedConfig) {
25+
if (config.env.PROD)
26+
return
2327
unpluginAutoExport(options!, config.resolve.alias)
2428
},
2529
},

0 commit comments

Comments
 (0)