Error Cannot call .tap() on a plugin that has not yet been defined. Call plugin(‘html‘).use(<Plugin
webpack打包报错如下:Error: Cannot call .tap() on a plugin that has not yet been defined. Call plugin(``'html'``).use(<Plugin>) first.解决方法:修改vue.config.js原配置:if (isProd) {config.plugin("html").tap((arg
·
webpack打包报错如下:
Error: Cannot call .tap() on a plugin that has not yet been defined. Call plugin(``'html'``).use(<Plugin>) first.
解决方法:
修改vue.config.js原配置:
if (isProd) {
config
.plugin("html")
.tap((args) => {
args[0].cdn = assetsCDN.assets;
return args;
});
}
修改后:
const HtmlWebpackPlugin = require("html-webpack-plugin");
if (isProd) {
config
.plugin("html")
.use(HtmlWebpackPlugin)
.tap((args) => {
args.cdn = assetsCDN.assets;
return args;
});
}
更多推荐
已为社区贡献2条内容
所有评论(0)