HtmlWebpackPLugin 忽略 Rule.generator.publicPath 值
作者: simple-russia创建于 2022年1月29日更新于 2026年1月2日
标签wontfix
Current behaviour
I have a CSS asset main.css, 2 js assets vendor.js and index.js that my HtmlWebpakPlugin injets into html document. I have to enter the specific publicPath. It works via webpack's output.publicPath or as an option inside new HtmlWebpackPlugin(options). All works great but the thing is, i have to import one of the JS files from another public path. So, suppose i have to import main.css and main.js from https://cdn-1.com/assets and vendor.js from https://cdn-2.com/assets. To ahieve this, i decided to use Rule.generator.publichPath which can give specific publicPath to assets that satisfy the test: regex condition. So this is my webpack config:
内容来源: jantimon/html-webpack-plugin