-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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(asset): add ?inline
and ?no-inline
queries to control inlining
#15454
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Sorry, for the force-push, I wanted to retrigger the By the way, the fact that |
I wonder why you didn't reuse the |
ba59738
to
1f77e94
Compare
Sorry for the mess, I'm not used to syncing a fork... I removed the test file since it seems pretty difficult to isolate the test with the new "shouldInline" function that requires the PluginContext. I also updated the This ended up in just a single-line update. |
In the last team meeting, we discussed about this PR. We are open to have this feature as long as the following points are resolved.
|
@sapphi-red I just updated the PR with your recommendations. I chose the I don't think I need to take a special look at deduping since I went with this solution, unless I overlooked something? Let me know if anything needs to change, thanks again for discussing it! |
What other meaning does it have then? The docs explicitly state that a If you want |
?inline
and ?no-inline
queries to control inlining
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM now. I think the query name looks fine compared to other alternatives.
/ecosystem-ci run |
📝 Ran ecosystem CI on
✅ analogjs, ladle, laravel, marko, nuxt, previewjs, quasar, qwik, rakkas, unocss, vite-environment-examples, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-swc, vite-plugin-svelte, vite-setup-catalogue, vitepress, vuepress |
|
Fix #15453
Description
Adding
?url
when importing a file disable inlineAdditional context
Recently, browsers disabled data URL in SVG elements (https://developer.chrome.com/blog/migrate-way-from-data-urls-in-svg-use?hl=en)
Since we can't know if a file will be used in an IMG or a USE tag, this option allow users to mark file as non-inlining.
cf this issue #15453
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).