Upgrade app-npm example to latest Webpack version#794
Conversation
| return -1; | ||
| } | ||
| return 0; | ||
| } |
There was a problem hiding this comment.
Does it need to be fixed in the webpack plugin instead?
There was a problem hiding this comment.
I believe this is here as a better solution than doing something similar in the template, right? Although, it would add all the locales i18n/[locale].[hash].js. The template's purpose is just to give users a basic idea of what they need to do. Users are probably using a better rendering approach in their apps anyway. :)
There was a problem hiding this comment.
Your description has a good summary about this, thanks.
However if you keep the i18n/en dependency and just add another one below, it seems to work as the latter de overrules the former en:
Yeap, this shouldn't happen (i.e., it shouldn't be necessary to keep en too). The test I'd make was to keep template as basic and simple as it was, i.e., to make minimal updates in this example necessary to support webpack 2.
There was a problem hiding this comment.
I hope the ordering issue can be solved within the plugin without the need to specify the chunks and ordering here.
| "vendor", | ||
| "globalize-compiled-data-en", | ||
| "main" | ||
| ] |
There was a problem hiding this comment.
Do we need to define these? This should be created automatically by the plugin, right?
There was a problem hiding this comment.
yes, I think the plugin should take care of including the chunks in the right order - I just don't know how to do it
|
Sorry for the long delay reviewing your PR |
|
Thank you @OsmHydrant |
What I did:
Details about faulty order workaround
By default the
index.htmlwould have contained those JS dependencies:vendor,mainand finally all the globalize files likei18n/en. This is a problem, asi18n/enis required to be inserted beforemain. I'm sure this can to be solved within the globalize-webpack-plugin, but I was unable to understand its internals.Remaining issue
Switching locale cannot be done by just replacing
i18n/enby e.g.i18n/deas this causes the following Webpack error in the browser:Uncaught TypeError: Cannot read property 'call' of undefinedHowever if you keep the
i18n/endependency and just add another one below, it seems to work as the latterdeoverrules the formeren:Since this is contradictory behavior to the previous version, I'm sure there must be a better solution within globalize-webpack-plugin.