0
,我發現了以下錯誤:如何關閉的WebPack掉毛
SyntaxError: arguments is a reserved word in strict mode
試圖做的時候:
console.log(arguments);
如何關閉的WebPack掉毛?我的配置看起來像這樣:
var plugins = [
new webpack.LoaderOptionsPlugin({
debug: true
}),
plugins.push(new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
}))
plugins.push(new webpack.optimize.UglifyJsPlugin())
];
webpack({
entry: entry.path,
output: {
filename: output['file name'],
path: output.path
},
resolve: {
modules: module.paths,
extensions: ['.js', '.jsx']
},
module: {
rules: [{
test: /.jsx?$/,
exclude: /node_modules/,
use: [{
loader: 'babel-loader',
options: {
babelrc: false,
presets: ['es2015', 'react']
}
}]
}]
},
resolveLoader: {
modules: loader.paths
},
plugins: plugins,
stats: {
colors: true,
errorDetails: true,
modules: true,
modulesSort: "field",
reasons: true,
}
}, function(err, stats) {
if (err) {
require('log')(err);
return;
}
const info = stats.toJson();
if (stats.hasErrors()) {
require('log')(info.errors);
}
else {
require('log')(options.launcher + " compiled")
}
if (stats.hasWarnings()) {
require('log')(info.warnings)
}
});
.... 話,這樣我可以張貼此問題與出計算器給我,我的問題是,大部分代碼.... 錯誤...
難道你還發布您的package.json? –