运行vue2报错如下的时候的时候:
解决方案:
1、安装 node-polyfill-webpack-plugin
npm install node-polyfill-webpack-plugin
2、在vue.config.js中添加
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
plugins: [new NodePolyfillPlugin()],
}
});