Open rxaviers opened 8 years ago
Demo for this issue https://github.com/rxaviers/react-globalize-webpack-plugin/tree/example-for-14. Steps: npm install && npm run build
.
@rxaviers Anything I can do to help with this?
Hi @mehcode, it would be great if you could check the "Cause" in the description, use the demo above, and try to fix it. Just let me know if you have any questions. Thanks for your help.
@rxaviers as you probably already know adding import Globalize from 'globalize';
fixes the above mentioned issue.
Hey @ambrons, thanks for your observation. Although, (if I understood correctly) your suggestion requires a change in the user code. Let's find out a solution in the plugin itself.
@rxaviers yes you're correct it's a user space fix. Probably more of a workaround, but thought it was worth noting. If I get some time I'll try to do a deeper dive.
Impact:
On
0.4.0
, apps that uses react-globalize exclusively (i.e., without using Globalize directly) getNo Globalize compiled data module found
when compiling on production mode. The i18n chunks are build, but their order appears incorrectly in index.html, making app to fail loading.Example: https://github.com/rxaviers/react-globalize-webpack-plugin/tree/example-for-14.
Quick workaround: Edit the built index.html and fix script loading order: vendor, i18n, app.
Cause:
On 0.4.x, when an app makes no direct use of
Globalize
,.createCompiledDataModule()
is never called, therefore no module in no chunks are created as a compiled module. Note that data from react-globalize are extracted and compiled just fine, it just happens they are not flagged/marked by globalize-webpack plugin. A fix might probably need to go in globalize-webpack-plugin, but I'm filing the issue here because it's related to react-globalize-webpack-plugin.