Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add jsdoc default value #11746

Merged
merged 2 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this defaults to target, what is the default when target = 'modules'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when target === 'modules', vite will replace 'modules' to ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14'], so the css target also is ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14']

*/
cssTarget?: TransformOptions['target'] | false
/**
Expand Down Expand Up @@ -196,21 +198,25 @@ 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
/**
* Set to false to disable reporting compressed chunk sizes.
* Can slightly improve build speed.
* @default true
*/
reportCompressedSize?: boolean
/**
Expand All @@ -221,6 +227,7 @@ export interface BuildOptions {
/**
* Rollup watch options
* https://rollupjs.org/guide/en/#watchoptions
* @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