Closed matthewborden closed 6 years ago
Solution: I wasn't providing the error callback in the
https://github.com/mzgoddard/hard-source-webpack-plugin/blob/0461a89a00b616e0a04a72c6ca5980714591268c/lib/hard-dependency-block-plugin.jsrequire.ensure
block and hard-source-webpack-plugin is doing argument number matching to find the chunk name.
After updating a file with a require.ensure
chunkName then the chunkname is exported. On the next build it didn't preserve chunk names.
I'm having a similar issue where dynamic imports aren't built unless a new config hash is written:
https://github.com/mzgoddard/hard-source-webpack-plugin/issues/306
I made the PR with a failing test:
https://github.com/mzgoddard/hard-source-webpack-plugin/pull/308
Asset Size Chunks Chunk Names
521bd388f3e6621e58aa6339ed32c34f.png 1.35 KiB [emitted]
08b762c66d13e03f57d4f6b459a27c39.png 378 bytes [emitted]
2494ded740be69ca76c1937ef8964188.png 591 bytes [emitted]
b61b045464acdadc943693c3f4f42e4c.png 5.61 KiB [emitted]
59b0f3b0d8ab9eba662c660d7dc45260.png 3.63 KiB [emitted]
66972ae56384b114f4e25875860a85f1.gif 2.1 KiB [emitted]
6a99a51cea73e725aa9cde7641782315.png 511 bytes [emitted]
09743aae5780b8b18c5c0ac9e83c252e.png 412 bytes [emitted]
5bebe5196c8e2e8bdc62658b7784abc4.png 2.86 KiB [emitted]
ea02548278644df754519e0f2df0c943.png 1.77 KiB [emitted]
b66ce755d33bfcb3305b0ef1cc78e549.png 2.58 KiB [emitted]
a84009f304990f7fd864c1ffa155cb78.png 1.34 KiB [emitted]
2a0ae1903058928f924aaf26a0b12d07.png 1.49 KiB [emitted]
9e68db4d15de7f5df54659c61d155f92.png 1.96 KiB [emitted]
03cf202c4e8213362898b37ef37265da.png 2.16 KiB [emitted]
e97963bde8a232e0e31a0015f71fdf4c.png 1.43 KiB [emitted]
684b160cfdb4f7b4630f4e736eaab549.jpg 20.3 KiB [emitted]
81fc69f9f846301429f634902fabf355.png 6.08 KiB [emitted]
0ddc825e66ada766450ab114aa0b3538.png 1.98 KiB [emitted]
a9e925437713d91e92d014aa6e80fabf.png 5.32 KiB [emitted]
528805ef8db07261e62c9c2984313cd6.png 3.37 KiB [emitted]
91d0d7a8f0582111105d188e3536eaf4.png 3.32 KiB [emitted]
f087cd9a767c529f5cc12c91ed213da2.png 1.27 KiB [emitted]
f7d02d600d4718fed37323828af558ff.png 584 bytes [emitted]
915dbc425cee60b3156589e97c8f3089.png 255 bytes [emitted]
d400c2880c3e37498760c84edab5fb2d.png 1.59 KiB [emitted]
4889784689c1b8109f97a0eecf9265f4.gif 723 bytes [emitted]
e15755718bf26d5b41513eb702ba01ea.png 682 bytes [emitted]
80844b32e304bf9d4ee42e37e93a5149.png 128 KiB [emitted]
7e8b08756415c8fe60963bafc70dfc72.png 3.17 KiB [emitted]
6bc6f1369852018efb420ceff6d81d48.png 1.74 KiB [emitted]
4d3e5f46ca2aeee432f93424b488e346.png 3.86 KiB [emitted]
9d7cb8106c8b24ec40e26a3a5c0c9081.png 1.16 KiB [emitted]
189512f0b303856b085d724adc1f6ce6.png 2.71 KiB [emitted]
476919875a75587d16023473b593ff43.png 773 bytes [emitted]
5889715271c2f2155d0167bbb8f11db3.png 9.61 KiB [emitted]
5e8c4083c72f010e34268bbe1dba4234.png 136 KiB [emitted]
491280e2b87342c89003f288881374e6.png 1.41 KiB [emitted]
1c52279d75b4ad9149c03375f5848f58.png 804 bytes [emitted]
feb5f7287d6995e16648c0523a315882.png 5.33 KiB [emitted]
c0fa13f3164032e36e660010b2694d7c.png 4.63 KiB [emitted]
06a7cc281a398858d519215d5101ce77.png 39 KiB [emitted]
7793092779ae33752fac424f18efe01c.png 40.1 KiB [emitted]
b71bf78765583fa5b9963167cf3fe075.png 320 bytes [emitted]
aafed0cf8bc0ef594d38cdc210603fac.png 996 bytes [emitted]
6427146f8d92c09105c74a1fb633905d.png 3.23 KiB [emitted]
a2f8d72ec2bffbf5aeea969ccb494fe8.png 9.28 KiB [emitted]
235b9591e41230a838db1432c58e9bfe.png 3.08 KiB [emitted]
68d5bfdf50f476ae42d63a21a2e9a3df.png 659 bytes [emitted]
45e0e6cf0fce6162e94ff0eb96c30fe7.png 3.68 KiB [emitted]
13cd5e6d669cca4971a8c90358f6f734.png 2.9 KiB [emitted]
c53d05d1cab5fb8b072589746da6fc36.png 491 bytes [emitted]
657efc5012c6ff607a70cf8f351aa5b4.png 1.12 KiB [emitted]
85719bdeaa75c5e6292d34fea1fdcbd0.png 10.8 KiB [emitted]
bd6b34e2d6ea91eb0da475c4525dc917.png 802 bytes [emitted]
d990a1d50b149be89d2f0ecc5b390725.png 792 bytes [emitted]
4e6e4fe3fa1a27d0ec9f7f4475af46e5.png 250 bytes [emitted]
984e1b898f416e9d960cd7a5982c2a3e.png 622 bytes [emitted]
3997bdca24a2c2ce1c583453a7401bae.png 584 bytes [emitted]
082c86e02ff7784def5e16898aa7aced.png 585 bytes [emitted]
fd09ef61c1682412d26869eebe01fcd8.png 420 bytes [emitted]
47aa5ad485a28d9c71a9ed4f80abf4e6.png 425 bytes [emitted]
b1886444971b4c1bcbd02b4d404ccb6e.png 419 bytes [emitted]
9eb0554cdfad334078619700eb0e6b69.png 1.57 KiB [emitted]
60c1b8f868fc359542715f4d0037a4ea.png 330 bytes [emitted]
1bb8cac8cf0c5b60fd120f6c797f114a.png 1.32 KiB [emitted]
7684cedd289be1dcfc59e9baf59294da.png 934 bytes [emitted]
ab59ca9dcd7d5f203b822437894d1081.png 1.83 KiB [emitted]
7d4889a96f6b7ef174703e010c06274c.png 2.39 KiB [emitted]
00c4583ad87d8d13f9e0a4077e478960.png 3.3 KiB [emitted]
546ec02a173d165c43294a30ef738afa.png 1.34 KiB [emitted]
ed5ae2307a48023f4c0f1a8bb7b54ec6.png 1.34 KiB [emitted]
83f615b14fc12eb1181f8241df998d33.png 1.38 KiB [emitted]
15505f6684d9a9c0ac4b9a6610152c9d.png 1.31 KiB [emitted]
998009ea2bb5b18f4dcfdeccd2f41b65.png 3.48 KiB [emitted]
AuthenticationModal.loadable.d42b28207e368dfe841b.js 105 KiB AuthenticationModal.loadable [emitted] AuthenticationModal.loadable
CartPage.loadable.3fd0f9afa1ee49d57c84.js 187 KiB CartPage.loadable [emitted] CartPage.loadable
CartSideBarV2.loadable.ec7fe058b9c3db7e0f72.js 23.1 KiB CartSideBarV2.loadable [emitted] CartSideBarV2.loadable
CheckoutPage.loadable.8bdd53819355561ef959.js 1.15 MiB CheckoutPage.loadable [emitted] CheckoutPage.loadable
CustomerSupportCenterPage.loadable.1fb76a9724b572a2cd0c.js 180 KiB CustomerSupportCenterPage.loadable [emitted] CustomerSupportCenterPage.loadable
FeedPage.loadable.59244970ef4e838da74a.js 171 KiB FeedPage.loadable [emitted] FeedPage.loadable
HeaderBarV2.loadable.a23c356065589f2a131a.js 26.5 KiB HeaderBarV2.loadable [emitted] HeaderBarV2.loadable
KlarnaCheckoutPage.loadable.fe8c923f9b3948e10a9a.js 32.7 KiB KlarnaCheckoutPage.loadable [emitted] KlarnaCheckoutPage.loadable
MerchantPage.loadable.f450b1935d99816dcd5c.js 81.6 KiB MerchantPage.loadable [emitted] MerchantPage.loadable
NavBarV2.loadable.23e36f103a3d940a097e.js 55.2 KiB NavBarV2.loadable [emitted] NavBarV2.loadable
NotificationPage.loadable.2010294e9243f66fdeb6.js 108 KiB NotificationPage.loadable [emitted] NotificationPage.loadable
PaymentIssuePage.loadable.0c93ed4a49a4bae362fb.js 21.2 KiB PaymentIssuePage.loadable [emitted] PaymentIssuePage.loadable
ProductModal.loadable.6425fe71436849ec1505.js 484 KiB ProductModal.loadable [emitted] ProductModal.loadable
ProductPage.loadable.212401c2d36cd8d26f7e.js 481 KiB ProductPage.loadable [emitted] ProductPage.loadable
ProductPageV2.loadable.79bff49ce0fe73f1c9e1.js 267 KiB ProductPageV2.loadable [emitted] ProductPageV2.loadable
ProfilePage.loadable.589a734c86b1158daba8.js 165 KiB ProfilePage.loadable [emitted] ProfilePage.loadable
SearchPage.loadable.65d0176f138b7a693602.js 81.5 KiB SearchPage.loadable [emitted] SearchPage.loadable
SettingsPage.loadable.ea3d00d203cc11879bf1.js 176 KiB SettingsPage.loadable [emitted] SettingsPage.loadable
WishlistFeedPage.loadable.7782679afde8fe3608d5.js 180 KiB WishlistFeedPage.loadable [emitted] WishlistFeedPage.loadable
ar.locale.8b8ab49d41de2c9f0b30.js 33.2 KiB ar.locale [emitted] ar.locale
be.locale.d798cc5f5a7245312b49.js 33.7 KiB be.locale [emitted] be.locale
bg.locale.931cb40583fbd457536d.js 35 KiB bg.locale [emitted] bg.locale
bs.locale.3d3276d2e77ecf6127fe.js 34.1 KiB bs.locale [emitted] bs.locale
cs.locale.407cdc74105e425381c4.js 33.5 KiB cs.locale [emitted] cs.locale
da.locale.0d58cf3938ac52bc7d35.js 33.8 KiB da.locale [emitted] da.locale
de.locale.1b5045632af79d793e3f.js 35.7 KiB de.locale [emitted] de.locale
el.locale.cd8efb529dfe2c54a31d.js 36.8 KiB el.locale [emitted] el.locale
en.locale.099c60c91f4430a636f7.js 32.8 KiB en.locale [emitted] en.locale
es.locale.7c5075f6a4ab1e511cd1.js 35.1 KiB es.locale [emitted] es.locale
et.locale.73b6da34f18c76137187.js 33.1 KiB et.locale [emitted] et.locale
fi.locale.5896bd1ec86823ad5f3a.js 33.5 KiB fi.locale [emitted] fi.locale
fr.locale.7a8ab4ca623e104bb097.js 36.1 KiB fr.locale [emitted] fr.locale
hi.locale.59ea997803b068a2c8f6.js 33.3 KiB hi.locale [emitted] hi.locale
hr.locale.0e5fb0a26c1ab25b1feb.js 33.9 KiB hr.locale [emitted] hr.locale
hu.locale.340df8775be368ed9b26.js 34.5 KiB hu.locale [emitted] hu.locale
id.locale.d8119632801f2979b321.js 34.8 KiB id.locale [emitted] id.locale
it.locale.26be73202457f455cdfe.js 35 KiB it.locale [emitted] it.locale
ja.locale.093ecff7d3a997b0e874.js 26.4 KiB ja.locale [emitted] ja.locale
ko.locale.73c87f1c8c14e1086ef8.js 32.7 KiB ko.locale [emitted] ko.locale
lt.locale.136b3231e33952aee30a.js 34.1 KiB lt.locale [emitted] lt.locale
lv.locale.b5ebc2b6abf69ed9cbef.js 33.8 KiB lv.locale [emitted] lv.locale
main.276a95dc5dcb92f22e62.js 1.19 MiB main [emitted] main
nb.locale.4b0c5cbd0c89c91ffe81.js 33.5 KiB nb.locale [emitted] nb.locale
nl.locale.fddae10ff7ce1a473249.js 34.7 KiB nl.locale [emitted] nl.locale
pl.locale.f0c3320386d6ef4b33fe.js 34.2 KiB pl.locale [emitted] pl.locale
pt.locale.696ff454811a847f9362.js 34.9 KiB pt.locale [emitted] pt.locale
ro.locale.440ded9a2253ee0d9ccc.js 35.6 KiB ro.locale [emitted] ro.locale
ru.locale.5662a02a91dc4a541e88.js 34.3 KiB ru.locale [emitted] ru.locale
runtime~main.9aff403ae61f92821b34.js 11.7 KiB runtime~main [emitted] runtime~main
sk.locale.7a265bc5b730ee4330b8.js 34 KiB sk.locale [emitted] sk.locale
sl.locale.c245580d1bff79ae923c.js 33.9 KiB sl.locale [emitted] sl.locale
sq.locale.ec26f30bebb52e8e5c3b.js 34.3 KiB sq.locale [emitted] sq.locale
sr.locale.d726171efc49a171a8d6.js 33.4 KiB sr.locale [emitted] sr.locale
sv.locale.3eebdc8f0f5076f1ed3c.js 33.5 KiB sv.locale [emitted] sv.locale
th.locale.a3de957617a4d68655ca.js 33.2 KiB th.locale [emitted] th.locale
tr.locale.fddfc72174a3494c39ab.js 33.5 KiB tr.locale [emitted] tr.locale
uk.locale.5ea69fa502487a2f5a3c.js 33.9 KiB uk.locale [emitted] uk.locale
vendor.6682070a701f36009610.js 2.77 MiB vendor [emitted] vendor
vi.locale.370fbe3f2533402e8c9a.js 34.5 KiB vi.locale [emitted] vi.locale
../../../templates/cozy/index.html 24.9 KiB [emitted]
precache-manifest.538ab1dbf8a93902f3999e16f879997f.js 10.3 KiB [emitted]
ServiceWorker.js 1.97 KiB [emitted]
Asset Size Chunks Chunk Names
2.797ba1c07dae9bc98c2e.js 35 KiB 2 [emitted]
28.2386b42948f9cbb938db.js 34 KiB 28 [emitted]
20.b73d6bd38abdc0b0ec72.js 34 KiB 20 [emitted]
21.cc80b4b7493adb32706f.js 33.8 KiB 21 [emitted]
22.96eb0852a933a87702b5.js 33.5 KiB 22 [emitted]
23.3319050bcd6d2d6e1460.js 34.7 KiB 23 [emitted]
24.1e1ca77d4271c371c78b.js 34.2 KiB 24 [emitted]
25.d6e37156b329524a02db.js 34.9 KiB 25 [emitted]
26.4d0c7c35a9bfd6fe9318.js 35.6 KiB 26 [emitted]
27.fbcb93237bfd1eb7de9f.js 34.3 KiB 27 [emitted]
0.d8d58c4f4678b768ef7f.js 33.2 KiB 0 [emitted]
29.fabb2d5c03692bd5ae44.js 33.9 KiB 29 [emitted]
30.ce26a37e1347ee8cc4a0.js 34.3 KiB 30 [emitted]
31.8deb36a87bddc17304dc.js 33.4 KiB 31 [emitted]
32.1be884f026fa8122fa73.js 33.5 KiB 32 [emitted]
33.0266087b6d82a45eba9b.js 33.2 KiB 33 [emitted]
34.1a4ff188bb87c42931ae.js 33.5 KiB 34 [emitted]
35.1d0ab7c936ce902c97b7.js 33.9 KiB 35 [emitted]
36.d43834b5f1a8600f82de.js 34.5 KiB 36 [emitted]
main.60540ab38c8201807ea2.js 1.19 MiB main [emitted] main
1.a643d270094bde68e1a7.js 33.7 KiB 1 [emitted]
19.65a766f15d1955f4dec3.js 32.7 KiB 19 [emitted]
3.8854374d39cb6796965d.js 34.1 KiB 3 [emitted]
4.e01aeff9a68ebf9d4f60.js 33.5 KiB 4 [emitted]
5.79fc6ea1237b89b0ad6c.js 33.8 KiB 5 [emitted]
6.7f8b73810d1bcecc5986.js 35.7 KiB 6 [emitted]
7.39775c3f87a5c95bc83b.js 36.8 KiB 7 [emitted]
8.a39ae976bdcfe0dd2324.js 32.8 KiB 8 [emitted]
9.3084ada9bd0c942c9c70.js 35.1 KiB 9 [emitted]
10.b9716bed61d7b5429929.js 33.1 KiB 10 [emitted]
11.2167a3307b79598cf740.js 33.5 KiB 11 [emitted]
12.4c2fbdd3945966bec051.js 36.1 KiB 12 [emitted]
13.73fb6ace52b2d8605257.js 33.3 KiB 13 [emitted]
14.c9d9692760459870a884.js 33.9 KiB 14 [emitted]
15.91cc639c3a179fac41de.js 34.5 KiB 15 [emitted]
16.8f15834172da8cd3bd52.js 34.8 KiB 16 [emitted]
17.2772ea03287a1d064c38.js 35 KiB 17 [emitted]
18.157b0f9b33cebe5b71c0.js 26.4 KiB 18 [emitted]
runtime~main.642d3a8277e338ef2860.js 10.6 KiB runtime~main [emitted] runtime~main
../../../templates/cozy/index.html 658 bytes [emitted]
precache-manifest.a5216035d5bf6ee718980089c5c29bb4.js 10 KiB [emitted]
ServiceWorker.js 1.97 KiB [emitted]
+ 95 hidden assets
I still seem to be having this problem. In watch mode (no cache, initial build), I see the output contains the xx.locale.*
files. When I change and save one of those files, the second output now doesn't have the name, just the id and hash.
My dynamic import looks like this:
// $FlowFixMe - dynamic import
import(/* webpackChunkName: "[request].locale" */
`./locales/${window.Globals.locale}`).then(({ default: localeMap }) => {
setLocaleMap(localeMap);
});
I am using v0.6.9 and webpack version 4.8.1
Steps to reproduce:
require.ensure
chunk names are missing).Output of the first build:
The output of the Second Build: