-
Notifications
You must be signed in to change notification settings - Fork 137
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
{{rootURL}} not working #1767
Comments
It seems like perhaps the replacement technique is to use webpack's |
Just to add to this, I'm working on the subresource integrity webpack plugin @jelhan released. Only my css and js files defined in the index.html are getting the correct The plugin uses
but because I'd expect every usage of More context here jelhan/webpack-subresource-integrity-embroider#11 (comment) |
So the issue that we're probably facing here is that the current webpack implementation for embroider doesn't treat the index.html as an entrypoint. Which means you can't actually use webpack effectively to change things in the index.html. We are aware of this issue and we're in the process of changing it with the main branch of embroider which is going to "invert the control" of embroider calling webpack right now and it will make our index.html a true entry point. Nothing has been merged to support that yet but if you want to keep track of the big changes coming in the next major release you can subscribe to this PR: #1701 |
I was considering creating a PR to fix this with the current way embroider works (so index.html not being an entry point) so the interim webpack-subresource-integrity-embroider can work properly, but I guess if index.html is going to become an entry point that PR wouldn't be accepted? Once the index.html is an entrypoint we probably won't need webpack-subresource-integrity-embroider at all since webpack-subresource-integrity will just be able to do what it needs to do directly. So until the next major embroider release I guess we'll have to find a workaround in webpack-subresource-integrity-embroider instead. |
From SRI perspective it is not that relevant if
@mansona Will both be provided by the planned changes in upcoming major? That would be great. I'm happy to deprecate webpack-subresource-integrity-embroider rather sooner than later. |
You could workaround this limitation of Embroider similar as how webpack-subresource-integrity-embroider does: Build a Webpack plugin, which parses the |
{{rootURL}}
on alink
tag insideindex.html
being replaced withfingerprint.prepend
in a classic app. ✅{{rootURL}}
on alink
tag insideindex.html
not being replaced withpublicAssetURL
in an embroider app. ❌The text was updated successfully, but these errors were encountered: