Skip to content

Commit 1777c90

Browse files
authored
fix: Don't use optimize-plugin's minify due to collisions (#1814)
* fix: Don't use `optimize-plugin`'s minify due to collisions * docs: Add changeset
1 parent 88c87ae commit 1777c90

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

.changeset/weak-trains-pay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'preact-cli': patch
3+
---
4+
5+
Fix for incorrect minification in some specific circumstances. Files should now minify slightly better too.

packages/cli/src/lib/webpack/webpack-client-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ function prodBuild(config) {
153153
polyfillsFilename: 'es-polyfills.js',
154154
exclude: [/^sw.*\.js/, /^dom-polyfills.*\.js/],
155155
modernize: false,
156+
minify: false,
156157
verbose: false,
157158
}),
158159
new SizePlugin({
@@ -166,7 +167,7 @@ function prodBuild(config) {
166167
minimizer: [
167168
new TerserPlugin({
168169
extractComments: false,
169-
test: /(sw|dom-polyfills).*\.js$/,
170+
test: /\.js$/,
170171
terserOptions: {
171172
output: { comments: false },
172173
mangle: true,

packages/cli/tests/images/build.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,33 @@ exports.default = {
1414
'ssr-build/ssr-bundle.css': 2346,
1515
'ssr-build/ssr-bundle.css.map': 3603,
1616

17-
'bundle.c74f5.js': 23145,
18-
'bundle.c74f5.js.map': 92586,
19-
'bundle.c74f5.legacy.js': 24195,
20-
'bundle.c74f5.legacy.js.map': 107151,
17+
'bundle.d55d3.js': 22978,
18+
'bundle.d55d3.js.map': 92378,
19+
'bundle.d55d3.legacy.js': 23646,
20+
'bundle.d55d3.legacy.js.map': 92673,
2121
'bundle.6329a.css': 1173,
2222
'bundle.6329a.css.map': 2165,
2323

24-
'dom-polyfills.aeb97.js': 5221,
25-
'dom-polyfills.aeb97.js.map': 18676,
24+
'dom-polyfills.99150.js': 5221,
25+
'dom-polyfills.99150.js.map': 18676,
2626
'es-polyfills.js': 46419,
2727

2828
'favicon.ico': 15086,
2929
'index.html': 3998,
3030
'manifest.json': 455,
3131
'preact_prerender_data.json': 11,
3232

33-
'route-home.chunk.6c974.js': 1179,
34-
'route-home.chunk.6c974.js.map': 3814,
35-
'route-home.chunk.6c974.legacy.js': 1222,
36-
'route-home.chunk.6c974.legacy.js.map': 4452,
33+
'route-home.chunk.ede4d.js': 1179,
34+
'route-home.chunk.ede4d.js.map': 3814,
35+
'route-home.chunk.ede4d.legacy.js': 1222,
36+
'route-home.chunk.ede4d.legacy.js.map': 3964,
3737
'route-home.chunk.d116e.css': 838,
3838
'route-home.chunk.d116e.css.map': 1406,
3939

40-
'route-profile.chunk.0401b.js': 3165,
41-
'route-profile.chunk.0401b.js.map': 13170,
42-
'route-profile.chunk.0401b.legacy.js': 3302,
43-
'route-profile.chunk.0401b.legacy.js.map': 15845,
40+
'route-profile.chunk.6856a.js': 3165,
41+
'route-profile.chunk.6856a.js.map': 13170,
42+
'route-profile.chunk.6856a.legacy.js': 3302,
43+
'route-profile.chunk.6856a.legacy.js.map': 13200,
4444
};
4545

4646
exports.prerender = {};

0 commit comments

Comments
 (0)