BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
执行启动项目命令时,出现 BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default。。。报错,原因是由于在webpack5中移除了nodejs核心模块的polyfill自动引入,所以需要手动引入。
·
执行启动项目命令时,出现 BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default。。。
报错,原因是由于在webpack5中移除了nodejs核心模块的polyfill自动引入,所以需要手动引入
解决方案
安装npm install node-polyfill-webpack-plugin
然后在vue.config.json中添加
const NodePolyfillPlugin = require(‘node-polyfill-webpack-plugin’)
module.exports = defineConfig({
configureWebpack: {
plugins: [new NodePolyfillPlugin()]
}
})
更多推荐
所有评论(0)