diff --git a/docs/guide/cli.md b/docs/guide/cli.md index 3fe64938cdbe8a..239d0bb663e877 100644 --- a/docs/guide/cli.md +++ b/docs/guide/cli.md @@ -27,7 +27,7 @@ vite [root] | `--base ` | Public base path (default: `/`) (`string`) | | `-l, --logLevel ` | info \| warn \| error \| silent (`string`) | | `--clearScreen` | Allow/disable clear screen when logging (`boolean`) | -| `--configLoader ` | Use `bundle` to bundle the config with Rolldown, or `runner` (experimental) to process it on the fly, or `native` (experimental) to load using the native runtime (default: `bundle`) | +| `--configLoader ` | Use `bundle` to bundle the config with Rolldown, or `native` to load using the native runtime (default: `bundle`) | | `--profile [name]` | Start built-in Node.js inspector and write the profile to `.cpuprofile` (check [Performance bottlenecks](/guide/troubleshooting#performance-bottlenecks)) (`boolean \| string`) | | `-d, --debug [feat]` | Show debug logs (`string \| boolean`) | | `-f, --filter ` | Filter debug logs (`string`) | @@ -66,7 +66,7 @@ vite build [root] | `--base ` | Public base path (default: `/`) (`string`) | | `-l, --logLevel ` | info \| warn \| error \| silent (`string`) | | `--clearScreen` | Allow/disable clear screen when logging (`boolean`) | -| `--configLoader ` | Use `bundle` to bundle the config with Rolldown, or `runner` (experimental) to process it on the fly, or `native` (experimental) to load using the native runtime (default: `bundle`) | +| `--configLoader ` | Use `bundle` to bundle the config with Rolldown, or `native` to load using the native runtime (default: `bundle`) | | `--profile [name]` | Start built-in Node.js inspector and write the profile to `.cpuprofile` (check [Performance bottlenecks](/guide/troubleshooting#performance-bottlenecks)) (`boolean \| string`) | | `-d, --debug [feat]` | Show debug logs (`string \| boolean`) | | `-f, --filter ` | Filter debug logs (`string`) | @@ -90,18 +90,18 @@ vite optimize [root] #### Options -| Options | | -| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `--force` | Force the optimizer to ignore the cache and re-bundle (`boolean`) | -| `-c, --config ` | Use specified config file (`string`) | -| `--base ` | Public base path (default: `/`) (`string`) | -| `-l, --logLevel ` | info \| warn \| error \| silent (`string`) | -| `--clearScreen` | Allow/disable clear screen when logging (`boolean`) | -| `--configLoader ` | Use `bundle` to bundle the config with Rolldown, or `runner` (experimental) to process it on the fly, or `native` (experimental) to load using the native runtime (default: `bundle`) | -| `-d, --debug [feat]` | Show debug logs (`string \| boolean`) | -| `-f, --filter ` | Filter debug logs (`string`) | -| `-m, --mode ` | Set env mode (`string`) | -| `-h, --help` | Display available CLI options | +| Options | | +| ------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `--force` | Force the optimizer to ignore the cache and re-bundle (`boolean`) | +| `-c, --config ` | Use specified config file (`string`) | +| `--base ` | Public base path (default: `/`) (`string`) | +| `-l, --logLevel ` | info \| warn \| error \| silent (`string`) | +| `--clearScreen` | Allow/disable clear screen when logging (`boolean`) | +| `--configLoader ` | Use `bundle` to bundle the config with Rolldown, or `native` to load using the native runtime (default: `bundle`) | +| `-d, --debug [feat]` | Show debug logs (`string \| boolean`) | +| `-f, --filter ` | Filter debug logs (`string`) | +| `-m, --mode ` | Set env mode (`string`) | +| `-h, --help` | Display available CLI options | ### `vite preview` @@ -117,19 +117,19 @@ vite preview [root] #### Options -| Options | | -| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `--host [host]` | Specify hostname (`string`) | -| `--port ` | Specify port (`number`) | -| `--strictPort` | Exit if specified port is already in use (`boolean`) | -| `--open [path]` | Open browser on startup (`boolean \| string`) | -| `--outDir ` | Output directory (default: `dist`) (`string`) | -| `-c, --config ` | Use specified config file (`string`) | -| `--base ` | Public base path (default: `/`) (`string`) | -| `-l, --logLevel ` | info \| warn \| error \| silent (`string`) | -| `--clearScreen` | Allow/disable clear screen when logging (`boolean`) | -| `--configLoader ` | Use `bundle` to bundle the config with Rolldown, or `runner` (experimental) to process it on the fly, or `native` (experimental) to load using the native runtime (default: `bundle`) | -| `-d, --debug [feat]` | Show debug logs (`string \| boolean`) | -| `-f, --filter ` | Filter debug logs (`string`) | -| `-m, --mode ` | Set env mode (`string`) | -| `-h, --help` | Display available CLI options | +| Options | | +| ------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `--host [host]` | Specify hostname (`string`) | +| `--port ` | Specify port (`number`) | +| `--strictPort` | Exit if specified port is already in use (`boolean`) | +| `--open [path]` | Open browser on startup (`boolean \| string`) | +| `--outDir ` | Output directory (default: `dist`) (`string`) | +| `-c, --config ` | Use specified config file (`string`) | +| `--base ` | Public base path (default: `/`) (`string`) | +| `-l, --logLevel ` | info \| warn \| error \| silent (`string`) | +| `--clearScreen` | Allow/disable clear screen when logging (`boolean`) | +| `--configLoader ` | Use `bundle` to bundle the config with Rolldown, or `native` to load using the native runtime (default: `bundle`) | +| `-d, --debug [feat]` | Show debug logs (`string \| boolean`) | +| `-f, --filter ` | Filter debug logs (`string`) | +| `-m, --mode ` | Set env mode (`string`) | +| `-h, --help` | Display available CLI options | diff --git a/packages/vite/src/node/cli.ts b/packages/vite/src/node/cli.ts index cc963ce66b3375..88e77a78c7a973 100644 --- a/packages/vite/src/node/cli.ts +++ b/packages/vite/src/node/cli.ts @@ -184,7 +184,7 @@ cli .option('--clearScreen', `[boolean] allow/disable clear screen when logging`) .option( '--configLoader ', - `[string] use 'bundle' to bundle the config with Rolldown, or 'runner' (experimental) to process it on the fly, or 'native' (experimental) to load using the native runtime (default: bundle)`, + `[string] use 'bundle' to bundle the config with Rolldown, or 'native' to load using the native runtime (default: bundle)`, ) .option( '--profile [name]', diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 0985d25333c8c9..39300a2bd5abc4 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -678,7 +678,13 @@ export interface ResolvedWorkerOptions { export interface InlineConfig extends UserConfig { configFile?: string | false - /** @experimental */ + /** + * The loader to use when loading the config file. + * + * `runner` is deprecated and will be removed in the next major version. + * + * @default 'bundle' + */ configLoader?: 'bundle' | 'runner' | 'native' /** @deprecated */ envFile?: false @@ -2410,6 +2416,13 @@ export async function loadConfigFromFile( `Unsupported configLoader: ${configLoader}. Accepted values are 'bundle', 'runner', and 'native'.`, ) } + if (configLoader === 'runner') { + createLogger(logLevel, { customLogger }).warn( + colors.yellow( + `The \`runner\` config loader is deprecated and will be removed in Vite 9. Use \`bundle\` or \`native\` instead.`, + ), + ) + } const start = performance.now() const getTime = () => `${(performance.now() - start).toFixed(2)}ms`