安裝
npm i node-polyfill-webpack-plugin
因?yàn)槲覀兊捻?xiàng)目使用webpack v5,其中polyfill Node核心模塊被刪除。所以,我們安裝它是為了在項(xiàng)目中訪問這些模塊文章來源地址http://www.zghlxwxcb.cn/news/detail-696349.html
vue.config.js文件
const { defineConfig } = require("@vue/cli-service");
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
plugins: [new NodePolyfillPlugin()],
optimization: {
splitChunks: {
chunks: "all",
},
},
},
});
文章來源:http://www.zghlxwxcb.cn/news/detail-696349.html
到了這里,關(guān)于Vue中啟動提示polyfill缺少-webpack v5版本導(dǎo)致的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!