The plugin options on .babelrcare given below:
{
"plugins": [
["transform-runtime", {
"polyfill": false,
"regenerator": true
}]
]
}
Because I do not want to use .babelrc, but I intend to use only webpack.config.js, I need to add options "polyfill": falseand "regenerator": truemy webpack.config.jsfile below, I can do it.
var webpack=require('webpack')
module.exports = {
context: __dirname + '/src/ui/',
entry: './ui.js',
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015', 'stage-0'],
plugins: ['react-html-attrs', 'transform-decorators-legacy',
'transform-class-properties', 'transform-runtime'],
}
}]
},
output: {
path: __dirname + '/src/public/js/',
filename: 'ui.bundle.js'
},
plugins: [],
};
This modification webpack.config.jsdoes not seem to work:
plugins: [
'react-html-attrs',
'transform-decorators-legacy',
'transform-class-properties',
['transform-runtime',{"polyfill": false, "regenerator": true}]
]