vue+webpack5:If you want to include a polyfill, you need to
vue+webpack5:If you want to include a polyfill, you need to
·
升级@vue/cli 5.0.1,发现 const path = require("path")异常
发现默认webpack 是,提示v5区别于v4不再自动引入Polyfills,需要手动添加
按照控制台提示
1、安装path-browserify
npm install path-browserify
2、在vue.config.js文件中配置
configureWebpack() {
return {
resolve: {
alias: {
"@": resolve("src"),
},
fallback: {
path: require.resolve("path-browserify"),
},
},
}
},
更多推荐
已为社区贡献1条内容
所有评论(0)