[optimizer] remove support for .jsx extension (#12712)

This commit is contained in:
Spencer 2017-07-07 16:12:05 -07:00 committed by GitHub
parent c20a48cbc9
commit 1f5a9dcc83
3 changed files with 4 additions and 7 deletions

View file

@ -62,17 +62,14 @@ Here is how import/require statements are resolved to a file:
* the first of the following paths that resolves to a **file** is our match
** path + '.js'
** path + '.json'
** path + '.jsx'
** path + '.less'
** path
** path/${basename(path)} + '.js'
** path/${basename(path)} + '.json'
** path/${basename(path)} + '.jsx'
** path/${basename(path)} + '.less'
** path/${basename(path)}
** path/index + '.js'
** path/index + '.json'
** path/index + '.jsx'
** path/index + '.less'
** path/index
* if none of the above paths matches then an error is thrown
* if none of the above paths matches then an error is thrown

View file

@ -50,7 +50,7 @@ export default (kibana) => {
if (config.get('tests_bundle.instrument')) {
env.addPostLoader({
test: /\.jsx?$/,
test: /\.js$/,
exclude: /[\/\\](__tests__|node_modules|bower_components|webpackShims)[\/\\]/,
loader: 'istanbul-instrumenter'
});

View file

@ -134,7 +134,7 @@ export default class BaseOptimizer {
{ test: /\.(woff|woff2|ttf|eot|svg|ico)(\?|$)/, loader: 'file-loader' },
{ test: /[\/\\]src[\/\\](core_plugins|ui)[\/\\].+\.js$/, loader: loaderWithSourceMaps('rjs-repack-loader') },
{
test: /\.jsx?$/,
test: /\.js$/,
exclude: babelExclude.concat(this.env.noParse),
loader: 'babel-loader',
query: babelOptions.webpack
@ -145,7 +145,7 @@ export default class BaseOptimizer {
},
resolve: {
extensions: ['.js', '.json', '.jsx', '.less', ''],
extensions: ['.js', '.json', '.less', ''],
postfixes: [''],
modulesDirectories: ['webpackShims', 'node_modules'],
fallback: [fromRoot('webpackShims'), fromRoot('node_modules')],