mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 10:52:35 +02:00
feat(core): faster transpiler option - siteConfig.future.experimental_faster.swcJsLoader
(#10435)
This commit is contained in:
parent
349a58453a
commit
418247ec87
30 changed files with 1298 additions and 847 deletions
|
@ -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).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue