[webpack] allow jsx in .js files

This commit is contained in:
spalger 2016-12-20 16:39:36 -07:00
parent 1018d524c8
commit ad6fe5766c
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,