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。。。
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default._第1张图片

报错,原因是由于在webpack5中移除了nodejs核心模块的polyfill自动引入,所以需要手动引入

解决方案:

1 . 安装 npm install node-polyfill-webpack-plugin


2 . 然后在vue.config.json中添加:
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')

configureWebpack: {
	plugins: [new NodePolyfillPlugin()]
}

你可能感兴趣的:(Bug,vue,bug)