Upgrade app-npm example to latest Webpack version #794
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did:
Details about faulty order workaround
By default the
index.html
would have contained those JS dependencies:vendor
,main
and finally all the globalize files likei18n/en
. This is a problem, asi18n/en
is 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/en
by e.g.i18n/de
as this causes the following Webpack error in the browser:Uncaught TypeError: Cannot read property 'call' of undefined
However if you keep the
i18n/en
dependency and just add another one below, it seems to work as the latterde
overrules the formeren
:Since this is contradictory behavior to the previous version, I'm sure there must be a better solution within globalize-webpack-plugin.