Stabilizing --config-loader=runner
/ --config-loader=native
#20162
Replies: 2 comments 2 replies
-
Nice write up! Probably also worth mentioning debugger usage. |
Beta Was this translation helpful? Give feedback.
-
Just an idea: what about implementing another I think it might be relatively easy and import { tsImport } from "tsx/esm/api";
export default (await tsImport(`./vite.config.ts`, import.meta.url)).default; |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
--config-loader=runner
--config-loader=native
Current limitations of each options
--config-loader=bundle
(default) (uses esbuild to bundle the config and execute that bundled file)npm:
specifer is used in config file #18822__dirname
/ dynamic import may work differently when it's not statically analyzablevite.config.ts
can't import untranspiled ts files from other packages in the same monorepo #5370, fix: avoid externalizing plugins that resolve to local files in monorepos #17323--conditions
(Respectconditions
arg from node #11838)--config-loader=runner
(uses module runner, it will transform the files on-demand).mjs
ortype=module
--conditions
(Respectconditions
arg from node #11838)--config-loader=native
(uses dynamic import, it will use the transform supported by the runtime or the registered Node.js loaders).mjs
ortype=module
(will be unblocked by syntax detection?)We're creating this discussion to gather feedback about this feature, so we can later use it while moving it out of experimental. We are also considering which config loader should be the default. Also we may remove the non-default ones.
Beta Was this translation helpful? Give feedback.
All reactions