我的webpack不会将const转换为var,在像IE11或Safari 9这样的浏览器中,由于该原因我收到了错误,是否需要对webpack进行一些配置?
我的webpack配置:
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
presets: ['es2015', 'stage-1', 'react'],
plugins: [
"transform-remove-strict-mode",
"transform-object-assign",
"transform-decorators-legacy"
]
}
}
},
{
test: /\.(png|gif|jpe?g||eot|svg|ttf|woff|woff2|cur)$/,
loader: "file-loader"
}
]
}