Closed juanda99 closed 8 years ago
The i18n files are js
files, not json
;)
And yes, if you want to import json files you need a json loader for webpack.
Hope this helps you :)
Uuups, jsfiles yes. But import * not working as in your code. Maybe is an option in the transpiler... using babel6
Make sure you have an index.js
in your i18n
folder which exports the single language files. Then import * from './i18n'
should work.
https://github.com/emmenko/redux-react-router-async-example/blob/babel-6/lib/i18n/index.js
It was due to a plugin. I reported the issue, thank you https://github.com/59naga/babel-plugin-add-module-exports/issues/20
I'm developing a react app using https://github.com/davezuko/react-redux-starter-kit.
I'm studing your code for the localization. However I can't load json language files as you do (import * is awesome for this). I can see it works in your project but not in mine: http://stackoverflow.com/questions/34453020/import-doesnt-load-the-object-in-es6
Is it due to some webpack loader issue or some kind of extra configuration?