我正在尝试合并Babel的转换运行时,以使我的代码与IE9兼容。但是,由于集成了该代码,该代码甚至无法在Chrome上运行。我得到的错误Uncaught TypeError: $export is not a function
上es6.object.define-property.js:3
。在我的.babelrc中没有“ transform-runtime”行的情况下,一切运行正常。有任何想法吗?
这是我的.babelrc
:
{
"plugins": [
"transform-runtime"
],
"presets": [
"es2015",
"react"
]
}
而我的webpack.config.js
:
var webpack = require('webpack');
var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js');
module.exports = {
entry: {
EventAdmin: './src/event_admin',
EventRender: './src/event_render'
},
output: {
path: '../public/js2',
filename: '[name].js' // Template based on keys in entry above
},
externals: {
// require("jquery") is external and available
// on the global var jQuery
'jquery': 'jQuery'
},
plugins: [commonsPlugin],
devtool: 'source-map',
module: {
loaders: [
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{
test: /\.js$/,
loader: 'babel-loader'
},
]
}
};