feat(core): faster transpiler option - siteConfig.future.experimental_faster.swcJsLoader (#10435)

This commit is contained in:
Sébastien Lorber 2024-08-23 13:48:52 +02:00 committed by GitHub
parent 349a58453a
commit 418247ec87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 1298 additions and 847 deletions

View file

@ -197,6 +197,9 @@ Example:
```js title="docusaurus.config.js"
export default {
future: {
experimental_faster: {
swcJsLoader: true,
},
experimental_storage: {
type: 'localStorage',
namespace: true,
@ -206,6 +209,8 @@ export default {
};
```
- `experimental_faster`: An object containing feature flags to make the Docusaurus build faster. This requires adding the `@docusaurus/faster` package to your site's dependencies. Use `true` as a shorthand to enable all flags.
- `swcJsLoader`: Use `true` to replace the default [Babel](https://babeljs.io/) JS loader by [SWC](https://swc.rs/) loader to speed up the bundling phase.
- `experimental_storage`: Site-wide browser storage options that theme authors should strive to respect.
- `type`: The browser storage theme authors should use. Possible values are `localStorage` and `sessionStorage`. Defaults to `localStorage`.
- `namespace`: Whether to namespace the browser storage keys to avoid storage key conflicts when Docusaurus sites are hosted under the same domain, or on localhost. Possible values are `string | boolean`. The namespace is appended at the end of the storage keys `key-namespace`. Use `true` to automatically generate a random namespace from your site `url + baseUrl`. Defaults to `false` (no namespace, historical behavior).