feat(asset): add ?inline and ?no-inline queries to control inlining#15454
Conversation
|
|
|
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
bluwy
left a comment
There was a problem hiding this comment.
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 |
|
…ng (vitejs#15454) Co-authored-by: bluwy <bjornlu.dev@gmail.com> Co-authored-by: 翠 / green <green@sapphi.red>
Fix #15453
Description
Adding
?urlwhen 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).