[webpack] allow jsx in .js files (#9578)

This commit is contained in:
Spencer 2016-12-21 00:20:16 -06:00 committed by GitHub
parent 3b82ea21bc
commit 3079cb4e68
3 changed files with 9 additions and 18 deletions

View file

@ -7,7 +7,7 @@ if (!process.env.BABEL_CACHE_PATH) {
exports.webpack = {
stage: 1,
nonStandard: false,
nonStandard: true,
optional: ['runtime']
};

View file

@ -10,7 +10,7 @@ if (!process.env.BABEL_CACHE_PATH) {
exports.webpack = {
stage: 1,
nonStandard: false,
nonStandard: true,
optional: ['runtime']
};

View file

@ -90,15 +90,6 @@ class BaseOptimizer {
return ExtractTextPlugin.extract(makeLoaderString(loaders));
};
const makeBabelLoader = query => {
return makeLoaderString([
{
name: 'babel-loader',
query: defaults({}, query || {}, babelOptions.webpack)
}
]);
};
return {
context: fromRoot('.'),
entry: this.bundles.toWebpackEntries(),
@ -143,15 +134,15 @@ class BaseOptimizer {
{ test: /\.(woff|woff2|ttf|eot|svg|ico)(\?|$)/, loader: 'file-loader' },
{ test: /[\/\\]src[\/\\](core_plugins|ui)[\/\\].+\.js$/, loader: loaderWithSourceMaps('rjs-repack-loader') },
{
test: /\.js$/,
test: /\.jsx?$/,
exclude: babelExclude.concat(this.env.noParse),
loader: makeBabelLoader(),
loader: makeLoaderString([
{
name: 'babel-loader',
query: babelOptions.webpack
}
]),
},
{
test: /\.jsx$/,
exclude: babelExclude.concat(this.env.noParse),
loader: makeBabelLoader({ nonStandard: true }),
}
],
postLoaders: this.env.postLoaders || [],
noParse: this.env.noParse,