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
+1-1
Original file line number
Diff line number
Diff line change
@@ -145,7 +145,7 @@ Produce SSR-oriented build. The value can be a string to directly specify the SS
145
145
146
146
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)
147
147
148
-
Note the `build.minify` option is not available when using the `'es'` format in lib mode.
148
+
Note the `build.minify` option does not minify whitespaces when using the `'es'` format in lib mode, as it removes pure annotations and break tree-shaking.
149
149
150
150
Terser must be installed when it is set to `'terser'`.
Copy file name to clipboardexpand all lines: docs/config/shared-options.md
+2
Original file line number
Diff line number
Diff line change
@@ -280,6 +280,8 @@ export default defineConfig({
280
280
})
281
281
```
282
282
283
+
When [`build.minify`](./build-options.md#build-minify) is `true`, you can configure to only minify [certain aspects](https://esbuild.github.io/api/#minify) of the code by setting either of `esbuild.minifyIdentifiers`, `esbuild.minifySyntax`, and `esbuild.minifyWhitespace` to `true`. Note the `esbuild.minify` option can't be used to override `build.minify`.
0 commit comments