从 Webpack 4 迁移到 Webpack 5 时,使用devtool
空值时出现错误(仅在生产模式下)。
module.exports = {
devtool: isProd ? '' : 'source-map',
// entry: ...
// output: ...
// module: ...
}
控制台中的消息:
ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration.devtool should match pattern "^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$".
BREAKING CHANGE since webpack 5: The devtool option is more strict.
Please strictly follow the order of the keywords in the pattern.
任何想法如何在生产模式下避免源映射?在那里输入什么?