-
Notifications
You must be signed in to change notification settings - Fork 42
"/" Added to generated script tags - Invalid script tags #83
Copy link
Copy link
Open
Description
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'
})
]
}
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels