diff --git a/packages/vite/src/node/build.ts b/packages/vite/src/node/build.ts index 70a6ae7de44ac7..e0d6bd5d08c48e 100644 --- a/packages/vite/src/node/build.ts +++ b/packages/vite/src/node/build.ts @@ -75,6 +75,7 @@ export interface BuildOptions { * * For custom targets, see https://esbuild.github.io/api/#target and * https://esbuild.github.io/content-types/#javascript for more details. + * @default 'modules' */ target?: 'modules' | TransformOptions['target'] | false /** @@ -122,6 +123,7 @@ export interface BuildOptions { * a niche browser that comes with most modern JavaScript features * but has poor CSS support, e.g. Android WeChat WebView, which * doesn't support the #RGBA syntax. + * @default target */ cssTarget?: TransformOptions['target'] | false /** @@ -196,16 +198,19 @@ export interface BuildOptions { * Build in library mode. The value should be the global name of the lib in * UMD mode. This will produce esm + cjs + umd bundle formats with default * configurations that are suitable for distributing libraries. + * @default false */ lib?: LibraryOptions | false /** * Produce SSR oriented build. Note this requires specifying SSR entry via * `rollupOptions.input`. + * @default false */ ssr?: boolean | string /** * Generate SSR manifest for determining style links and asset preload * directives in production. + * @default false */ ssrManifest?: boolean | string /** @@ -217,6 +222,7 @@ export interface BuildOptions { /** * Set to false to disable reporting compressed chunk sizes. * Can slightly improve build speed. + * @default true */ reportCompressedSize?: boolean /** @@ -227,6 +233,7 @@ export interface BuildOptions { /** * Rollup watch options * https://rollupjs.org/configuration-options/#watch + * @default null */ watch?: WatcherOptions | null } diff --git a/packages/vite/src/node/plugins/resolve.ts b/packages/vite/src/node/plugins/resolve.ts index 9bc07e7f1f422b..1d64e1da55b5a3 100644 --- a/packages/vite/src/node/plugins/resolve.ts +++ b/packages/vite/src/node/plugins/resolve.ts @@ -62,6 +62,9 @@ const debug = createDebugger('vite:resolve-details', { }) export interface ResolveOptions { + /** + * @default ['module', 'jsnext:main', 'jsnext'] + */ mainFields?: string[] /** * @deprecated In future, `mainFields` should be used instead. @@ -69,8 +72,14 @@ export interface ResolveOptions { */ browserField?: boolean conditions?: string[] + /** + * @default ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json'] + */ extensions?: string[] dedupe?: string[] + /** + * @default false + */ preserveSymlinks?: boolean } diff --git a/packages/vite/src/node/server/index.ts b/packages/vite/src/node/server/index.ts index 3833ab6b49ad08..992c35b85b3d38 100644 --- a/packages/vite/src/node/server/index.ts +++ b/packages/vite/src/node/server/index.ts @@ -92,6 +92,7 @@ export interface ServerOptions extends CommonServerOptions { watch?: WatchOptions /** * Create Vite dev server to be used as a middleware in an existing server + * @default false */ middlewareMode?: boolean | 'html' | 'ssr' /** diff --git a/packages/vite/src/node/ssr/index.ts b/packages/vite/src/node/ssr/index.ts index cdd9e9e5dd24b0..be2d436749dc80 100644 --- a/packages/vite/src/node/ssr/index.ts +++ b/packages/vite/src/node/ssr/index.ts @@ -11,7 +11,7 @@ export interface SSROptions { /** * Define the target for the ssr build. The browser field in package.json * is ignored for node but used if webworker is the target - * Default: 'node' + * @default 'node' */ target?: SSRTarget /** @@ -20,6 +20,7 @@ export interface SSROptions { * left marked as experimental to give users more time to update to ESM. CJS builds requires * complex externalization heuristics that aren't present in the ESM format. * @experimental + * @default 'esm' */ format?: SSRFormat /**