Closed nkovacs closed 6 years ago
Actually, it's not an error with the json loader, it looks like bundle can't be used with the require([]) syntax.
I fixed it like this:
(require('bundle?name=[path]!cldr-data/main/' + locale + '/numbers.json'))(cb)
(require('bundle?name=[path]!cldr-data/main/' + locale + '/ca-gregorian.json'))(cb)
(require('bundle?name=[path]!cldr-data/main/' + locale + '/timeZoneNames.json'))(cb)
@nkovacs Please provide more info about your current setup (webpack.config.js
etc), did you found a solution for this ?
Install cldr-data and json-loader
Add this to the config:
And then try this:
This combines all the jsons in one locale directory into a single chunk, which is good. Unfortunately, the chunk looks like this:
And I get the following error:
Uncaught json: E_INVALID_PAR_TYPE: {"expected":"Plain Object","name":"json"}