Skip to content
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

feat: allow use assets in webmanifest icons #397

Closed
wants to merge 10 commits into from

Conversation

userquin
Copy link
Member

@userquin userquin commented Oct 15, 2022

It works if referenced via static import or directly in src attribute: example on vue-router on src/App.vue: check the docs here https://deploy-preview-397--vite-plugin-pwa-legacy.netlify.app/guide/static-assets.html#reusing-src-assets-images

The docs will go to old docs and the new ones, this PR on draft until finished.

On dev server with dev options enabled it just works, Vite will resolve the src/assets/xxx asset.

closes #211 and #396

@netlify
Copy link

netlify bot commented Oct 15, 2022

Deploy Preview for vite-plugin-pwa-legacy ready!

Name Link
🔨 Latest commit e8baa3c
🔍 Latest deploy log https://app.netlify.com/sites/vite-plugin-pwa-legacy/deploys/6369164085e2770008bb414d
😎 Deploy Preview https://deploy-preview-397--vite-plugin-pwa-legacy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@userquin userquin marked this pull request as ready for review October 15, 2022 17:51
@userquin
Copy link
Member Author

userquin commented Oct 15, 2022

@antfu maybe we can have some problem with this on vite-ssg, since we're using it without the bundle param, I'll try to check it tmr on vitesse template.

EDIT: I'll check it also on îles, VitePress, SvelteKit and Astro integrations.

@userquin userquin requested a review from antfu October 15, 2022 18:04
@userquin
Copy link
Member Author

userquin commented Oct 15, 2022

I need to test all integrations, a fast review just checking source code:

/cc @ElMassimo sorry to ping you directly, maybe you can upgrade the plugin to 0.13.1 and try commenting out previous line.

@userquin
Copy link
Member Author

userquin commented Oct 15, 2022

I Will try to emit the icon if missing from the bundle, I think we shouldn't add this behavior.

If ppl Just want to add the icons to the assets folder instead public folder and those icons not being used (vía static import or used directly in the src attr) we need to do here the work done by Vite, no makes sense.

@userquin userquin closed this Apr 30, 2024
@userquin userquin deleted the userquin/feat-icons-from-assets branch April 30, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto pull in references icons in manifest config
1 participant