Usage of webpack public path inconsistent
See original GitHub issueRelated to https://github.com/arthurbergmz/webpack-pwa-manifest/issues/5
It seems I might have jumped too early. There is an issue with the option useWebpackPublicPath
and its handling in the HtmlWebpackPlugin
. First, I’m of the opinion that this option is irrelevant (the manifest.json should always be generated in the output path). Nevertheless, I’d like to go through the inconsistency of its usage right now. So, with following webpack options:
- path:
dist/
- publicPath:
/assets/
as ./dist
and with the (default) value of false, it will:
- generate the manifest.json in the output path:
./dist/manifest.[hash].json
- inject the link tag
<link rel="manifest" href="manifest.[hash].json" />
so, the file is in the proper place, but the url is wrong (it should contain the publicPath
from webpack). when I switch it to true (use webpack public path):
- generates the manifest.json in this path:
./dist/assets/manifest.[hash].json
- inject the link tag
<link rel="manifest" href="/assets/manifest.[hash].json" />
so now the URL is right, but the file isn’t in the proper place, therefore the server will return 404.
My feeling is that, somewhere in the codebase, both options are being misused. Nevertheless, I’d remove the useWebpackPublicPath
option altogether and just use the right webpack variables.
What do you think?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:13 (7 by maintainers)
Top GitHub Comments
Thx also for the quick fix, mate! 😃
@arthurbergmz file is in the right place, and the url is the right one. I approve this fix 👍