-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Images in assets/img not displaying in content #38
Comments
Thank you for your contribution. We will check and reply to you as soon as possible. |
Hello @ShaunLWM, First of all, contentscript should understand that we want an image from our extension and not from a page. For that we can use the
Oops, still not working. Check the errors in chrome-extension page and discover the line saying our image should be listed under
After that, reload the extension and you should see your image. TLDR: P.S. Mind that if you will try to import a png or jpg, you should add something like |
Understood. Will have a look. Thank you so much for the detailed explanation, appreciate it. |
how about other resources like pdfs or so? I get compilation erros for those files.
|
Have you added the PDF extension to your resources? |
@Jonghakseo I ended up using the vite plugin-url https://www.npmjs.com/package/@rollup/plugin-url to load binary files |
@all-contributors please add @Araneline for question |
I've put up a pull request to add @Araneline! 🎉 |
Steps to reproduce
src/assets/img
folder (example: login.svg)import LogSvg from "@assets/img/login.svg";
yarn dev
and import extension to ChromeThe text was updated successfully, but these errors were encountered: