set server babel options to match browser ones
This commit is contained in:
parent
435cea4fc9
commit
bd269ed52d
|
@ -1,2 +1,2 @@
|
|||
require('babel/register');
|
||||
require('babel/register')(require('../optimize/babelOptions'));
|
||||
require('./cli');
|
||||
|
|
|
@ -11,6 +11,7 @@ let utils = require('requirefrom')('src/utils');
|
|||
let fromRoot = utils('fromRoot');
|
||||
let OptmzBundles = require('./OptmzBundles');
|
||||
let OptmzUiModules = require('./OptmzUiModules');
|
||||
let babelOptions = require('./babelOptions');
|
||||
|
||||
let kbnTag = `Kibana ${ utils('packageJson').version }`;
|
||||
|
||||
|
@ -75,22 +76,14 @@ class BaseOptimizer extends EventEmitter {
|
|||
test: /\.js$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
loader: 'babel',
|
||||
query: {
|
||||
optional: ['runtime'],
|
||||
stage: 1,
|
||||
nonStandard: false
|
||||
}
|
||||
query: babelOptions
|
||||
},
|
||||
{
|
||||
// explicitly require .jsx extension to support jsx
|
||||
test: /\.jsx$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
loader: 'babel',
|
||||
query: {
|
||||
optional: ['runtime'],
|
||||
stage: 1,
|
||||
nonStandard: true
|
||||
}
|
||||
query: babelOptions
|
||||
}
|
||||
].concat(this.modules.loaders),
|
||||
noParse: this.modules.noParse,
|
||||
|
|
5
src/optimize/babelOptions.js
Normal file
5
src/optimize/babelOptions.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
module.exports = {
|
||||
optional: ['runtime'],
|
||||
stage: 1,
|
||||
nonStandard: true
|
||||
};
|
Loading…
Reference in a new issue