-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the src of script is wrong with html-webpack-plugin v5.3.1 #202
Comments
@greenHandOnWeb I have this issue too. Did you find a workaround? |
I found a solution. We need to use the new AddAssetHtmlPlugin({
filepath: path.resolve(__dirname, '../public/properties.js'),
includeRelatedFiles: false,
publicPath: '',
}) |
I think it's because util.js use compilation.options.output.publicPath, if not set it, it will be 'auto', I not sure it's bug or not.
|
or {
mode: "development",
output: {
publicPath: "", //add this line |
PR very much welcome that fixes this |
1.the config:
plugins:[ new HtmlWebpackPlugin({ template: './src/index.html' }), new webpack.DllReferencePlugin({ manifest: resolve(__dirname, 'dll/manifest.json') }), new AddAssetHtmlWebpackPlugin({ filepath: require.resolve("./dll/jquery.js") }) ]
2.run 'webpack'
success
3.but the inserted script label is wrong
inserted script
<script defer="defer" src="auto/jquery.js"></script>
the src should be 'jquery.js' rather than 'auto/jquery.js'
4.It's may a bug, would you mind give some advice?
The text was updated successfully, but these errors were encountered: