Skip to content

Commit

Permalink
feat: active properties mangle to reduce the build size in rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Feb 27, 2024
1 parent f5ded24 commit 9d5bf3d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{
"gzip": false,
"running": false,
"limit": "33.24 KB",
"limit": "33 KB",
"path": "assets/js/build/modern/shop.js",
"brotli": false
},
Expand Down
14 changes: 12 additions & 2 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const ROLLUP_LEGACY = {
{
targets: {
browsers: [
'> 0.5%, last 2 versions, Firefox ESR, not dead',
'last 2 Chrome versions',
'last 2 Firefox versions',
'last 2 Safari versions',
],
},
useBuiltIns: 'usage',
Expand Down Expand Up @@ -90,7 +92,15 @@ Object.keys(modern).forEach(function (item) {
resolve(),
commonjs(),
babel(ROLLUP_MODERN),
terser(),
terser({
compress: {
passes: 2,
},
mangle: {
reserved: [ '__', '_n', '_nx', '_x' ],
properties: true
},
}),
],
});
});
Expand Down

0 comments on commit 9d5bf3d

Please sign in to comment.