c12
c12 copied to clipboard
Support vite(6) as config loader
Describe the feature
(context: quickly talking with @yyx990803)
Vite 6 with environment API allows loading ts config files similar to jiti.
We can optionally support vite as a config loader for .ts support, faster resolutions, custom plugins, etc.
/cc @danielroe @antfu @patak-dev would love to hear your early thoughts!
Additional information
- [X] Would you be willing to help implement this feature?
cc @sheremet-va
- https://github.com/vitejs/vite/pull/18637
We had an idea to expose this as a function like “import” (inlines the environment when called, not good for performance or memory to be honest 👀) and possibly introduce “vite run” command in the future.
@sheremet-va Maybe it could be coupled with an unimport() API (mimicking clear require.cache) that allows to free-up memory? We probably need something similar to also allow reloading config same as jiti with disabled cache.