Skip to content

Commit

Permalink
fix: first replace then minify
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 19, 2020
1 parent 75952d4 commit 520b59a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,18 @@ export function createPlugins(
// minify only in production mode
if (process.env.NODE_ENV === "production") {
plugins.push(...[
// set NODE_ENV to production
replace({
'process.env.NODE_ENV':JSON.stringify('production'),
}),
// minify
terser({
ecma: 2018,
warnings: true,
compress: {
drop_console: false,
},
}),
// set NODE_ENV to production
replace({
'process.env.NODE_ENV':JSON.stringify('production'),
}),
])
}

Expand Down

0 comments on commit 520b59a

Please sign in to comment.