forked from cybrespace/mastodon
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.
This commit is contained in:
parent
1fc096ec75
commit
68dca26a5d
|
@ -1,7 +1,10 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
// include react-intl because transform-react-remove-prop-types needs to apply to it
|
// 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',
|
loader: 'babel-loader',
|
||||||
options: {
|
options: {
|
||||||
forceEnv: process.env.NODE_ENV || 'development',
|
forceEnv: process.env.NODE_ENV || 'development',
|
||||||
|
|
Loading…
Reference in New Issue