Open andreivictor opened 1 year ago
Can you provide reproducible test repo?
Sorry for the delay,
Please check the following repo: https://github.com/andreivictor/webpack-starter-html-loader
When running webpack serve
, the script is included ok:
<script src="modernizr.e6183722abbaa4f38f55.js"></script>
On build, the script is included in html like this:
<script src="modernizr.e6183722abbaa4f38f55.js"></script>
, but in the dist
folder there is:
modernizr.7111043e1acedc783e40.js
Thank you!
Current behaviour 💣
In the
index.html
I want to include a static JS File (a 3rd party JS file, not bundled withwebpack
):index.html
This file should be included before the main JS file (injected by
html-webpack-plugin)
and should not be defered. It's name should also be unique (hashed).After build, the
dist
folder contains:index.html
:but the generated js file is:
modernizr.d14201e2d4a0ec290a14.js
So the filenames do not match (content hashes are different) and the browser returns a 404 error.
When running
webpack serve
, it seems that the generated hashes are the same.Expected behaviour ☀️
After build, the generated filename should match the filename referanced in
dist
html file.Reproduction Example 👾
Use the following code above.
webpack.config.js
Environment 🖥