我真的很难让我的编译后的js在IE11中工作,因为它使散布运算符窒息了。我似乎无法通过Neutrino.js配置正确地转换价差,并且想知道是否有人可以提供帮助。
我的Neutrino配置为:
const { merge } = require('@neutrinojs/compile-loader');
module.exports = neutrino => {
neutrino.options.output = 'dist/public/assets';
neutrino.use('@neutrinojs/react', {
html: false,
hot: true,
publicPath: `/assets/`,
devServer: {
proxy: 'http://nolii.test:8888',
},
presets: [
[
'babel-preset-env',
{
modules: false,
targets: {
browsers: [
'Chrome >= 52',
'FireFox >= 44',
'Safari >= 7',
'Explorer >= 10',
'last 4 Edge versions',
],
},
},
],
],
minify: {
babel: {},
style: {},
image: true,
},
style: {
test: /\.s?css$/,
loaders: [
'postcss-loader',
{
loader: 'sass-loader',
useId: 'sass',
},
],
},
});
neutrino.config.module
.rule('compile')
.use('babel')
.tap(options =>
merge(
{
plugins: [
require.resolve('babel-plugin-transform-decorators-legacy'),
require.resolve('babel-plugin-transform-decorators'),
require.resolve('babel-plugin-transform-class-properties'),
require.resolve('babel-plugin-transform-es2015-spread'),
require.resolve('babel-plugin-transform-object-rest-spread'),
],
},
options,
),
);
};
但是我的输出代码充满了...
-任何关于我要去哪里的想法都将受到高度赞赏。