Skip to content

Instantly share code, notes, and snippets.

@joakin
Last active November 2, 2017 11:04
Show Gist options
  • Save joakin/82d32b33227f82baa38abb05ca67f5e2 to your computer and use it in GitHub Desktop.
Save joakin/82d32b33227f82baa38abb05ca67f5e2 to your computer and use it in GitHub Desktop.
Broken webpack commons chunk stuff

master

dist/public/index.e2772e0a6203bb4e7d8c.js              19K
dist/public/pages/about.6cf1f3ef68a498cda3ef.js        2.0K
dist/public/pages/home.027c5030538475eb1253.js         1.9K
dist/public/pages/not-found.2c096c3f04c871042160.js    448B
dist/public/pages/style-guide.d86c4d68eb850d6c36e4.js  2.0K
dist/public/pages/summary.45286bca48ea38c1929b.js      8.1K
dist/public/pages/wiki.670fa01a683d03f3c5df.js         10K
dist/public/runtime.c036110d9b32450e4fb0.js            1.7K
dist/public/vendor.2901ebc67815bbff6383.js             22K

latest, deepChildren & async

dist/public/0.90e930a2e35b968db8f0.js                  14K
dist/public/index.898d568eb6fca382c91e.js              4.9K
dist/public/pages/about.82e8ac428a248a2acbbb.js        2.0K
dist/public/pages/home.b720c13912c4681aa83f.js         1.9K
dist/public/pages/not-found.0ba66e4e5d4da6f726cc.js    448B
dist/public/pages/style-guide.a6dc976a1ce90345dc94.js  2.0K
dist/public/pages/summary.7597d02c96e6e8197af1.js      8.1K
dist/public/pages/wiki.b43422b087af102526f0.js         10K
dist/public/runtime.af02afd35a5431909f68.js            1.7K
dist/public/vendor.2901ebc67815bbff6383.js             22K

latest, like master

dist/public/index.84cb3fa611f8da94bbb5.js              4.8K
dist/public/pages/about.71697989077e06339d2c.js        14K
dist/public/pages/home.0ad17e1e78e8c66e484d.js         14K
dist/public/pages/not-found.428ad62674b108aff056.js    9.9K
dist/public/pages/style-guide.d69441ab8f388893d8a6.js  16K
dist/public/pages/summary.05023b8004ac6e05bf6e.js      22K
dist/public/pages/wiki.1daa761c2c4b9edf772f.js         24K
dist/public/runtime.e14c4d042a867105bc22.js            1.7K
dist/public/vendor.be0eb951a32cd662052a.js             22K

latest, deepChildren

dist/public/index.84cb3fa611f8da94bbb5.js              4.8K
dist/public/pages/about.71697989077e06339d2c.js        14K
dist/public/pages/home.0ad17e1e78e8c66e484d.js         14K
dist/public/pages/not-found.428ad62674b108aff056.js    9.9K
dist/public/pages/style-guide.d69441ab8f388893d8a6.js  16K
dist/public/pages/summary.05023b8004ac6e05bf6e.js      22K
dist/public/pages/wiki.1daa761c2c4b9edf772f.js         24K
dist/public/runtime.e14c4d042a867105bc22.js            1.7K
dist/public/vendor.be0eb951a32cd662052a.js             22K

latest, explicit chunks and name on commons chunk

dist/public/index.e2772e0a6203bb4e7d8c.js              19K
dist/public/pages/about.6cf1f3ef68a498cda3ef.js        2.0K
dist/public/pages/home.027c5030538475eb1253.js         1.9K
dist/public/pages/not-found.2c096c3f04c871042160.js    448B
dist/public/pages/style-guide.d86c4d68eb850d6c36e4.js  2.0K
dist/public/pages/summary.45286bca48ea38c1929b.js      8.1K
dist/public/pages/wiki.670fa01a683d03f3c5df.js         10K
dist/public/runtime.c036110d9b32450e4fb0.js            1.7K
dist/public/vendor.2901ebc67815bbff6383.js             22K
@niedzielski
Copy link

@joakin, here's what I see using the patch with an npm i, npm -s run build, and ls -lh dist/public/*.js dist/public/pages/*.js:

-rw-r--r-- 1 stephen stephen  14K Nov  1 08:46 dist/public/0.a6778bc09c562520d79d.js
-rw-r--r-- 1 stephen stephen 5.0K Nov  1 08:46 dist/public/index.8333527c5e479485c37c.js
-rw-r--r-- 1 stephen stephen 2.1K Nov  1 08:46 dist/public/pages/about.7532c178b7a1fe632263.js
-rw-r--r-- 1 stephen stephen 2.0K Nov  1 08:46 dist/public/pages/home.9ffb9119cf99ff24aeec.js
-rw-r--r-- 1 stephen stephen  448 Nov  1 08:46 dist/public/pages/not-found.5e8c557eb91e25e4b02a.js
-rw-r--r-- 1 stephen stephen 2.1K Nov  1 08:46 dist/public/pages/style-guide.26e7c617ed3fbffd33bb.js
-rw-r--r-- 1 stephen stephen 8.2K Nov  1 08:46 dist/public/pages/summary.1464ab246f60868ce861.js
-rw-r--r-- 1 stephen stephen  11K Nov  1 08:46 dist/public/pages/wiki.5186f78a808174100e96.js
-rw-r--r-- 1 stephen stephen 1.8K Nov  1 08:46 dist/public/runtime.7af0455c44710b6c580d.js
-rw-r--r-- 1 stephen stephen  22K Nov  1 08:46 dist/public/vendor.2901ebc67815bbff6383.js

Dev and prod builds appear to work functionally too.

@niedzielski
Copy link

@joakin, I just realized all your sizes are rather convenient multiples of 4KiB. Maybe an ls logical filesize issue? Here's what I get with du dist/public/*.js dist/public/pages/*.js (reordered to match ls):

16	dist/public/0.a6778bc09c562520d79d.js
8	dist/public/index.8333527c5e479485c37c.js
4	dist/public/pages/about.7532c178b7a1fe632263.js
4	dist/public/pages/home.9ffb9119cf99ff24aeec.js
4	dist/public/pages/not-found.5e8c557eb91e25e4b02a.js
4	dist/public/pages/style-guide.26e7c617ed3fbffd33bb.js
12	dist/public/pages/summary.1464ab246f60868ce861.js
12	dist/public/pages/wiki.5186f78a808174100e96.js
4	dist/public/runtime.7af0455c44710b6c580d.js
24	dist/public/vendor.2901ebc67815bbff6383.js

@joakin
Copy link
Author

joakin commented Nov 1, 2017

@niedzielski du doesn't report the bytes like ls does, but that is not the point. Your run is the same as latest-deepchildren--async which has an extra async chunk that we do not want. That extra async chunk with the common code form the pages should be folded into index.

@joakin
Copy link
Author

joakin commented Nov 1, 2017

I've updated the gist with the ls sizes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment