【发布时间】:2018-09-16 23:24:31
【问题描述】:
我将尝试将 uglify 与 webpack 一起使用,但出现此错误:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration has an unknown property 'optimization'. These properties are valid:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
我有
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
和
optimization: {
minimizer: [new UglifyJsPlugin()]
}
在我的 webpack.config.js 中,看起来 webpack 无法识别“优化”?
【问题讨论】: