You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without the CDN plugin the HtmlWebPack plugin creates correct includes: src="main.js"
If i enable the CDN plugin the generated link is wrong: src="/main.js" (trailing /)
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin')
const WebpackCdnPlugin = require('webpack-cdn-plugin');
module.exports = {
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
plugins: [
new HtmlWebpackPlugin(),
new WebpackCdnPlugin({ // this plugins adds a / to the path "<script src="main.js">" --> <script src="/main.js">
modules: [],
publicPath: '/node_modules'
})
]
}
Without the CDN plugin the HtmlWebPack plugin creates correct includes:
src="main.js"
If i enable the CDN plugin the generated link is wrong:
src="/main.js"
(trailing /)I've create a minimal setup to reproduce this bug:
https://github.com/Amberg/cdn-plugin-test
Workaround:
Set the "publicPath" property to "" of the ,HtmlWebPack solves the problem
The text was updated successfully, but these errors were encountered: