執(zhí)行啟動(dòng)項(xiàng)目命令時(shí),出現(xiàn) BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default。。。
報(bào)錯(cuò),原因是由于在webpack5中移除了nodejs核心模塊的polyfill自動(dòng)引入,所以需要手動(dòng)引入
解決方案:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-577951.html
1 . 安裝 npm install node-polyfill-webpack-plugin文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-577951.html
2 . 然后在vue.config.json中添加:
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
configureWebpack: {
plugins: [new NodePolyfillPlugin()]
}
到了這里,關(guān)于BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!