-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Unable to include a static JS file (generated hashed filename does not match the one in the index.html) #1814
Comments
Can you provide reproducible test repo? |
Sorry for the delay, Please check the following repo: When running On build, the script is included in html like this: 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 🖥
The text was updated successfully, but these errors were encountered: