diff options
author | unarist <m.unarist@gmail.com> | 2017-06-25 19:49:53 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-25 12:49:53 +0200 |
commit | 68dca26a5d36eacb7d7e691635a14b6562ba7cf1 (patch) | |
tree | c5fdeaeadbf0bd5f862258100e8e7cd6f1b7e822 /config/webpack/loaders | |
parent | 1fc096ec7598e688b1cd804188575a853ac84541 (diff) |
Fix react-intl/locale-data import issue on production build (#3937)
Webpack seems to fail to import `react-intl/locale-data/*.js` if those files has been proceed by babel, and this also breaks applying our translation. Note that this won't be a problem on English locale, because react-intl includes it as default and works fine without manually added locale-data. Also this issue seems to only occurs on production build, but I'm not sure about reason.
Diffstat (limited to 'config/webpack/loaders')
-rw-r--r-- | config/webpack/loaders/babel.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/config/webpack/loaders/babel.js b/config/webpack/loaders/babel.js index ae65db9eb..a1992a450 100644 --- a/config/webpack/loaders/babel.js +++ b/config/webpack/loaders/babel.js @@ -1,7 +1,10 @@ module.exports = { test: /\.js$/, // include react-intl because transform-react-remove-prop-types needs to apply to it - exclude: /node_modules[\/\\](?!react-intl)/, + exclude: { + test: /node_modules/, + exclude: /react-intl[\/\\](?!locale-data)/, + }, loader: 'babel-loader', options: { forceEnv: process.env.NODE_ENV || 'development', |