Skip to content

Commit

Permalink
fix: Don't use optimize-plugin's minify due to collisions (#1814)
Browse files Browse the repository at this point in the history
* fix: Don't use `optimize-plugin`'s minify due to collisions

* docs: Add changeset
  • Loading branch information
rschristian authored Jan 19, 2024
1 parent 88c87ae commit 1777c90
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/weak-trains-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'preact-cli': patch
---

Fix for incorrect minification in some specific circumstances. Files should now minify slightly better too.
3 changes: 2 additions & 1 deletion packages/cli/src/lib/webpack/webpack-client-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function prodBuild(config) {
polyfillsFilename: 'es-polyfills.js',
exclude: [/^sw.*\.js/, /^dom-polyfills.*\.js/],
modernize: false,
minify: false,
verbose: false,
}),
new SizePlugin({
Expand All @@ -166,7 +167,7 @@ function prodBuild(config) {
minimizer: [
new TerserPlugin({
extractComments: false,
test: /(sw|dom-polyfills).*\.js$/,
test: /\.js$/,
terserOptions: {
output: { comments: false },
mangle: true,
Expand Down
28 changes: 14 additions & 14 deletions packages/cli/tests/images/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ exports.default = {
'ssr-build/ssr-bundle.css': 2346,
'ssr-build/ssr-bundle.css.map': 3603,

'bundle.c74f5.js': 23145,
'bundle.c74f5.js.map': 92586,
'bundle.c74f5.legacy.js': 24195,
'bundle.c74f5.legacy.js.map': 107151,
'bundle.d55d3.js': 22978,
'bundle.d55d3.js.map': 92378,
'bundle.d55d3.legacy.js': 23646,
'bundle.d55d3.legacy.js.map': 92673,
'bundle.6329a.css': 1173,
'bundle.6329a.css.map': 2165,

'dom-polyfills.aeb97.js': 5221,
'dom-polyfills.aeb97.js.map': 18676,
'dom-polyfills.99150.js': 5221,
'dom-polyfills.99150.js.map': 18676,
'es-polyfills.js': 46419,

'favicon.ico': 15086,
'index.html': 3998,
'manifest.json': 455,
'preact_prerender_data.json': 11,

'route-home.chunk.6c974.js': 1179,
'route-home.chunk.6c974.js.map': 3814,
'route-home.chunk.6c974.legacy.js': 1222,
'route-home.chunk.6c974.legacy.js.map': 4452,
'route-home.chunk.ede4d.js': 1179,
'route-home.chunk.ede4d.js.map': 3814,
'route-home.chunk.ede4d.legacy.js': 1222,
'route-home.chunk.ede4d.legacy.js.map': 3964,
'route-home.chunk.d116e.css': 838,
'route-home.chunk.d116e.css.map': 1406,

'route-profile.chunk.0401b.js': 3165,
'route-profile.chunk.0401b.js.map': 13170,
'route-profile.chunk.0401b.legacy.js': 3302,
'route-profile.chunk.0401b.legacy.js.map': 15845,
'route-profile.chunk.6856a.js': 3165,
'route-profile.chunk.6856a.js.map': 13170,
'route-profile.chunk.6856a.legacy.js': 3302,
'route-profile.chunk.6856a.legacy.js.map': 13200,
};

exports.prerender = {};
Expand Down

0 comments on commit 1777c90

Please sign in to comment.