-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Conversation
9b913c3
to
6581113
Compare
@@ -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 |
There was a problem hiding this comment.
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'
?
There was a problem hiding this comment.
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']
packages/vite/src/node/build.ts
Outdated
@@ -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 ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values are not under our control I assume? So when esbuild changes them, our docs are stale, are they?
Maybe forward to their docs (like we did already in the description above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the docs, the build.target
default is 'modules'
, but when build.target === 'module'
vite will replace modules
to ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14']
. So i think the real default is ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think theIDE tooltips show 'modules'
is more friendly, althought the real default is ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14']
.
@@ -152,7 +153,7 @@ export interface FileSystemServeOptions { | |||
* This will have higher priority than `allow`. | |||
* picomatch patterns are supported. | |||
* | |||
* @default ['.env', '.env.*', '*.crt', '*.pem'] | |||
* @default ['.env', '.env.*', '*.\{crt,pem\}'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be wrong, but I think this was done because \
get rendered in IDE tooltips directly instead of working as escaping char, so pls revert this
packages/vite/src/node/ssr/index.ts
Outdated
@@ -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'' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @default 'node'' | |
* @default 'node' |
packages/vite/src/node/ssr/index.ts
Outdated
@@ -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'' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @default 'esm'' | |
* @default 'esm' |
6581113
to
637ed25
Compare
637ed25
to
61f2831
Compare
Description
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).