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
Magic Comments not working for images #16399
Comments
It should be implemented by HtmlWebpackPlugin, webpack generate links only for JS assets |
Hi @alexander-akait ! That's great! Thank you! Do you have a small code sample of how to do that with the plugin? |
No, it should be implemented by an author of the plugin |
What you may need is this plug-in: https://github.com/principalstudio/html-webpack-inject-preload. |
It also supports "rel='prefetch '". |
I asked @jantimon (jantimon/html-webpack-plugin#1768 (comment)) to mvoe html-webpack-plugin to webpack-contrib to I will fix a lot of issues and implement such things |
Hi |
jantimon/html-webpack-plugin#1317 |
@icy0307 Yeah, we should improve it in html-webpack-plugin |
This issue had no activity for at least three months. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
I am trying to preload/prefetch an image so that I don't have to be connected to the internet at the exact moment to display the image. It's for a "you are offline" page in my app.
I was reading online that the webpack magic comments feature might be able to do that.
https://medium.com/webpack/link-rel-prefetch-preload-in-webpack-51a52358f84c
It's not working for me.
Bug report
The image that I am trying to preload/prefetch does not show and there is no
<link rel
tag added to the DOM.If the current behavior is a bug, please provide the steps to reproduce.
Checkout the demo repository here:
https://github.com/aubreyquinn/preload-webpack-demo/tree/main
What is the expected behavior?
I should be able to pre-fetch an image and have the
link rel
tag added to my DOM.Other relevant information:
The text was updated successfully, but these errors were encountered: