You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/config/build-options.md
+10-7Lines changed: 10 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,10 +129,10 @@ In this case, you need to set `build.cssTarget` to `chrome61` to prevent vite fr
129
129
130
130
## build.cssMinify
131
131
132
-
-**Type:**`boolean | 'esbuild' | 'lightningcss'`
133
-
-**Default:** the same as [`build.minify`](#build-minify) for client, `'esbuild'` for SSR
132
+
-**Type:**`boolean | 'lightningcss' | 'esbuild'`
133
+
-**Default:** the same as [`build.minify`](#build-minify) for client, `'lightningcss'` for SSR
134
134
135
-
This option allows users to override CSS minification specifically instead of defaulting to `build.minify`, so you can configure minification for JS and CSS separately. Vite uses `esbuild` by default to minify CSS. Set the option to `'lightningcss'` to use [Lightning CSS](https://lightningcss.dev/minification.html)instead. If selected, it can be configured using [`css.lightningcss`](./shared-options.md#css-lightningcss).
135
+
This option allows users to override CSS minification specifically instead of defaulting to `build.minify`, so you can configure minification for JS and CSS separately. Vite uses [Lightning CSS](https://lightningcss.dev/minification.html)by default to minify CSS. It can be configured using [`css.lightningcss`](./shared-options.md#css-lightningcss). Set the option to `'esbuild'` to use esbuild instead.
136
136
137
137
## build.sourcemap
138
138
@@ -277,16 +277,19 @@ During the SSR build, static assets aren't emitted as it is assumed they would b
277
277
278
278
## build.minify
279
279
280
-
-**Type:**`boolean | 'terser' | 'esbuild'`
281
-
-**Default:**`'esbuild'` for client build, `false` for SSR build
-**Default:**`'oxc'` for client build, `false` for SSR build
282
282
283
-
Set to `false` to disable minification, or specify the minifier to use. The default is [esbuild](https://github.com/evanw/esbuild) which is 20 ~ 40x faster than terser and only 1 ~ 2% worse compression. [Benchmarks](https://github.com/privatenumber/minification-benchmarks)
283
+
Set to `false` to disable minification, or specify the minifier to use. The default is [Oxc Minifier](https://oxc.rs/docs/guide/usage/minifier) which is 30 ~ 90x faster than terser and only 0.5 ~ 2% worse compression. [Benchmarks](https://github.com/privatenumber/minification-benchmarks)
284
+
285
+
`build.minify: 'esbuild'` is deprecated and will be removed in the future.
284
286
285
287
Note the `build.minify` option does not minify whitespaces when using the `'es'` format in lib mode, as it removes pure annotations and breaks tree-shaking.
286
288
287
-
Terser must be installed when it is set to `'terser'`.
289
+
esbuild or Terser must be installed when it is set to `'esbuild'` or `'terser'` respectively.
Copy file name to clipboardExpand all lines: docs/config/shared-options.md
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -353,36 +353,44 @@ If set to `true`, imported JSON will be transformed into `export default JSON.pa
353
353
354
354
If set to `'auto'`, the data will be stringified only if [the data is bigger than 10kB](https://v8.dev/blog/cost-of-javascript-2019#json:~:text=A%20good%20rule%20of%20thumb%20is%20to%20apply%20this%20technique%20for%20objects%20of%2010%20kB%20or%20larger).
355
355
356
-
## esbuild
356
+
## oxc
357
357
358
-
-**Type:**`ESBuildOptions | false`
358
+
-**Type:**`OxcOptions | false`
359
359
360
-
`ESBuildOptions` extends [esbuild's own transform options](https://esbuild.github.io/api/#transform). The most common use case is customizing JSX:
360
+
`OxcOptions` extends [Oxc Transformer's options](https://oxc.rs/docs/guide/usage/transformer). The most common use case is customizing JSX:
361
361
362
362
```js
363
363
exportdefaultdefineConfig({
364
-
esbuild: {
365
-
jsxFactory:'h',
366
-
jsxFragment:'Fragment',
364
+
oxc: {
365
+
jsx: {
366
+
runtime:'classic',
367
+
pragma:'h',
368
+
pragmaFrag:'Fragment',
369
+
},
367
370
},
368
371
})
369
372
```
370
373
371
-
By default, esbuild is applied to `ts`, `jsx` and `tsx` files. You can customize this with `esbuild.include` and `esbuild.exclude`, which can be a regex, a [picomatch](https://github.com/micromatch/picomatch#globbing-features) pattern, or an array of either.
374
+
By default, transformation by Oxc is applied to `ts`, `jsx` and `tsx` files. You can customize this with `oxc.include` and `oxc.exclude`, which can be a regex, a [picomatch](https://github.com/micromatch/picomatch#globbing-features) pattern, or an array of either.
372
375
373
-
In addition, you can also use `esbuild.jsxInject` to automatically inject JSX helper imports for every file transformed by esbuild:
376
+
In addition, you can also use `oxc.jsxInject` to automatically inject JSX helper imports for every file transformed by Oxc:
374
377
375
378
```js
376
379
exportdefaultdefineConfig({
377
-
esbuild: {
380
+
oxc: {
378
381
jsxInject:`import React from 'react'`,
379
382
},
380
383
})
381
384
```
382
385
383
-
When [`build.minify`](./build-options.md#build-minify) is `true`, all minify optimizations are applied by default. To disable [certain aspects](https://esbuild.github.io/api/#minify) of it, set any of `esbuild.minifyIdentifiers`, `esbuild.minifySyntax`, or `esbuild.minifyWhitespace` options to `false`. Note the `esbuild.minify` option can't be used to override `build.minify`.
386
+
Set to `false` to disable transformation by Oxc.
387
+
388
+
## esbuild
389
+
390
+
-**Type:**`ESBuildOptions | false`
391
+
-**Deprecated**
384
392
385
-
Set to `false` to disable esbuild transforms.
393
+
This option is converted to `oxc` option internally. Use `oxc` option instead.
0 commit comments