Vue 编译报错:BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
Vue 编译报错:BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default
·
错误如图。
检查下来是因为 webpack 5 以前的版本包含 polyfills。错误信息也给出了这个原因。
解决方法:
在 vue.config.js 文件中添加如下配置:
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
module.exports = {
configureWebpack: config => {
const plugins = []
plugins.push(new NodePolyfillPlugin())
}
}
再次编译问题解决
更多推荐
已为社区贡献1条内容
所有评论(0)