![](/img/trans.png)
[英]How to turn off webpack bundling changing class names for just 1 class?
[英]How to turn off webpack linting
我收到以下错误:
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)
}
});
....这样的话使我可以在不使用stackoverflow的情况下发布此问题,这给我一个错误,即我的问题主要是代码。
这是一个SyntaxError ,这意味着您的代码损坏,无法编译。 当您忘记键入大括号的一半时,会遇到相同的错误。
这不是一个皮棉问题(对于代码样式)。
您很可能错误地将保留字arguments
用作变量名。 将其重命名为其他名称。
在下面运行代码,您可以看到没有webpack仍然出现错误。
"use strict"; var arguments = 1; console.log(arguments)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.