Skip to content

Commit

Permalink
chore: add jsdoc default value (vitejs#11746)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenfan0 authored and futurGH committed Feb 26, 2023
1 parent a133964 commit be77efa
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/vite/src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
/**
Expand Down Expand Up @@ -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
/**
Expand Down Expand Up @@ -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
/**
Expand All @@ -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
/**
Expand All @@ -227,6 +233,7 @@ export interface BuildOptions {
/**
* Rollup watch options
* https://rollupjs.org/configuration-options/#watch
* @default null
*/
watch?: WatcherOptions | null
}
Expand Down
9 changes: 9 additions & 0 deletions packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,24 @@ const debug = createDebugger('vite:resolve-details', {
})

export interface ResolveOptions {
/**
* @default ['module', 'jsnext:main', 'jsnext']
*/
mainFields?: string[]
/**
* @deprecated In future, `mainFields` should be used instead.
* @default true
*/
browserField?: boolean
conditions?: string[]
/**
* @default ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']
*/
extensions?: string[]
dedupe?: string[]
/**
* @default false
*/
preserveSymlinks?: boolean
}

Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/node/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/vite/src/node/ssr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
/**
Expand All @@ -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
/**
Expand Down

0 comments on commit be77efa

Please sign in to comment.