json - babel v6 + react-intl v2 + webpack extraction of messages to file -


i extract messages source code json file, using babel v6, react-intl v2, , webpack. it's compiling fine, not extracting anything. how make v2 of react-intl extract messages?

there's option messagesdir:

i've tried:

json { "extra": { "react-intl": { "messagesdir": "./i18n", "enforcedescriptions": true } } }

with webpack config

text // snip - { test: /\.js$/, 4 loader: 'babel-loader', - query: { 5 // react needed jsx syntax 5 // es2015 needed modules 5 // stage0 needed splats (...variable) 5 presets: ['react', 'es2015', 'stage-0'], 5 // react-intl extracts i18n messages shared file 5 // add-module-exports removes need `require('a').default` 5 plugins: ['react-intl', 'add-module-exports'], 5 cachedirectory: true 5 }, 4 exclude: /node_modules|bower_components/ 4 }, // snip

gives: "index.js: unknown option: /.babelrc.extra" error message.

i've tried adding above extra property webpack configuration above, too. gives similar error message.

versions:

✗ npm ls | grep "intl" ├─┬ babel-plugin-react-intl@2.0.0 │ └── intl-messageformat-parser@1.2.0 ├── intl@1.0.1 ├── intl-locales-supported@1.0.0 ├── intl-messageformat@1.2.0 ├─┬ react-intl@2.0.0-pr-3 │ ├── intl-format-cache@2.0.4

the answer use custom webpack syntax:

syntax thus:

5 plugins: [ - ['react-intl', { 6 'messagesdir': './i18n' 6 }], 'add-module-exports']


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -