Skip to content

Commit 520b59a

Browse files
committed
fix: first replace then minify
1 parent 75952d4 commit 520b59a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,18 @@ export function createPlugins(
226226
// minify only in production mode
227227
if (process.env.NODE_ENV === "production") {
228228
plugins.push(...[
229+
// set NODE_ENV to production
230+
replace({
231+
'process.env.NODE_ENV':JSON.stringify('production'),
232+
}),
233+
// minify
229234
terser({
230235
ecma: 2018,
231236
warnings: true,
232237
compress: {
233238
drop_console: false,
234239
},
235240
}),
236-
// set NODE_ENV to production
237-
replace({
238-
'process.env.NODE_ENV':JSON.stringify('production'),
239-
}),
240241
])
241242
}
242243

0 commit comments

Comments
 (0)