refactor(build): remove quotes from preload marker#16562
Conversation
|
|
|
Hmm, you're right. I didn't think that esbuild could break the I wonder if it's better to skip strings altogether though and use a plain |
Maybe a plain |
|
/ecosystem-ci run Checking the ecosystem for this to see if it works. If it does, I think we can further improve the code since we're no longer dealing with quotes. |
This comment was marked as outdated.
This comment was marked as outdated.
|
📝 Ran ecosystem CI on
✅ analogjs, astro, histoire, ladle, laravel, marko, nuxt, previewjs, quasar, qwik, rakkas, remix, sveltekit, unocss, vike, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-pages, vite-plugin-react-swc, vite-plugin-svelte, vite-plugin-vue, vite-setup-catalogue, vitepress |
|
Seems like this strategy works fine too. I think we can polish up the code a bit to no longer refer it as quotes. |
replace |
bluwy
left a comment
There was a problem hiding this comment.
Thanks! This LGTM. I'll let others have a review on this too in case I miss something.
|
I think the idea behind the quotes was originally to keep the code as a valid module. Maybe we should use |
Do you mean that , an undefined variable |
|
It may break if there is a plugin that is checking that all variables are properly defined. I don't know if we are respecting this in all our replacements though, just trying to understand why we have been using quotes so far. I like the idea that our plugins are generating a valid module at each step. |
|
Isn't using plain I suppose the only risk here is that EDIT: Using |
I think that, |
U R correct, |
…ELOAD__" This reverts commit 5b4ff2a.
patak-dev
left a comment
There was a problem hiding this comment.
Sorry for the noise, ya, it looks safe to directly use an undefined variable here. I'm a bit puzzled as to why the quotes were added then. I'm good with doing this change 👍🏼
|
I'll queue this for the next minor then to be safe 👍 |
Description
relaxing
preloadMarkerWithQuotereg to replace str like this :"__VITE_PRELOA\
D\
__"
But , there will be some performance problems.
fixes #16529