First created app's config.compilerOptions applies to all later apps
Vue version
3.3.8
Link to minimal reproduction
https://codepen.io/markrian/pen/JjxOmrw?editors=1011
Steps to reproduce
- Create two apps via
createApp
- Configure the second one of them to use custom
compilerOptions
- Observe those
compilerOptions
are ignored on the second app, as if you didn't set them.
OR
- Create two apps via
createApp
- Configure the first one of them to use custom
compilerOptions
- Observe those
compilerOptions
also apply (incorrectly) to the second app.
What is expected?
Each app should respect only its own compilerOptions
.
What is actually happening?
It looks like apps share compilerOptions
in some way.
System Info
No response
Any additional comments?
In my minimal reproduction I only test whitespace: 'preserve'
. I don't actually know if it applies to all compilerOptions
or just that one - I've made an assumption about the effects here.
Ah, I think I see what's going on here.
Apps share a cache of compiled templates, so the first app caches the generated render function, and the second app returns it.
Would it make more sense for each app to have its own compiler cache, for exactly this reason of differing compilerOptions
? Or maybe splitting the cache based on compilerOptions
?