mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[webpack] allow jsx in .js files (#9584)
Backports PR #9578
**Commit 1:**
[webpack] allow jsx in .js files
* Original sha: ad6fe5766c
* Authored by spalger <spalger@users.noreply.github.com> on 2016-12-20T23:39:36Z
This commit is contained in:
parent
bf8d8b0414
commit
b94b064f7d
3 changed files with 9 additions and 18 deletions
|
@ -7,7 +7,7 @@ if (!process.env.BABEL_CACHE_PATH) {
|
|||
|
||||
exports.webpack = {
|
||||
stage: 1,
|
||||
nonStandard: false,
|
||||
nonStandard: true,
|
||||
optional: ['runtime']
|
||||
};
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ if (!process.env.BABEL_CACHE_PATH) {
|
|||
|
||||
exports.webpack = {
|
||||
stage: 1,
|
||||
nonStandard: false,
|
||||
nonStandard: true,
|
||||
optional: ['runtime']
|
||||
};
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue