Skip to content

Commit

Permalink
Use 2-pass terser compression (WordPress#24821)
Browse files Browse the repository at this point in the history
Terser supports multi-pass compression, which is slower at build time,
but produces smaller output. This change switches from the default
1-pass compression to 2-pass compression.
  • Loading branch information
sgomes authored Nov 9, 2020
1 parent 89b5367 commit cdd9b9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ const config = {
output: {
comments: /translators:/i,
},
compress: {
passes: 2,
},
},
extractComments: false,
} ),
Expand Down
3 changes: 3 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ module.exports = {
output: {
comments: /translators:/i,
},
compress: {
passes: 2,
},
},
extractComments: false,
} ),
Expand Down

0 comments on commit cdd9b9e

Please sign in to comment.