diff --git a/packages/create-docusaurus/templates/classic-typescript/package.json b/packages/create-docusaurus/templates/classic-typescript/package.json index 88f1117814f7..56bba3947c42 100644 --- a/packages/create-docusaurus/templates/classic-typescript/package.json +++ b/packages/create-docusaurus/templates/classic-typescript/package.json @@ -15,7 +15,6 @@ "typecheck": "tsc" }, "dependencies": { - "@docusaurus/babel": "3.5.2", "@docusaurus/core": "3.5.2", "@docusaurus/preset-classic": "3.5.2", "@mdx-js/react": "^3.0.0", diff --git a/packages/create-docusaurus/templates/classic/package.json b/packages/create-docusaurus/templates/classic/package.json index c0dad98a022c..2d2535698e05 100644 --- a/packages/create-docusaurus/templates/classic/package.json +++ b/packages/create-docusaurus/templates/classic/package.json @@ -14,7 +14,6 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@docusaurus/babel": "3.5.2", "@docusaurus/core": "3.5.2", "@docusaurus/preset-classic": "3.5.2", "@mdx-js/react": "^3.0.0", diff --git a/packages/create-docusaurus/templates/shared/babel.config.js b/packages/create-docusaurus/templates/shared/babel.config.js deleted file mode 100644 index ca4e55cbf11f..000000000000 --- a/packages/create-docusaurus/templates/shared/babel.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - presets: ['@docusaurus/babel/preset'], -}; diff --git a/website/babel.config.js b/website/babel.config.js deleted file mode 100644 index 25875e982f12..000000000000 --- a/website/babel.config.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -module.exports = { - presets: ['@docusaurus/babel/preset'], -}; diff --git a/website/docs/configuration.mdx b/website/docs/configuration.mdx index 8278b5cc3fe9..8415e71cf5cb 100644 --- a/website/docs/configuration.mdx +++ b/website/docs/configuration.mdx @@ -275,7 +275,15 @@ If you just want to use those fields on the client side, you could create your o ## Customizing Babel Configuration {#customizing-babel-configuration} -For new Docusaurus projects, we automatically generated a `babel.config.js` in the project root. +Docusaurus transpiles your site's source code using Babel by default. If you want to customize the Babel configuration, you can do so by creating a `babel.config.js` file in your project root. + +To use the built-in preset as a base configuration, install the following package and use it + +```bash npm2yarn +npm install --save @docusaurus/theme-live-codeblock +``` + +Then use the preset in your `babel.config.js` file: ```js title="babel.config.js" export default { @@ -283,4 +291,4 @@ export default { }; ``` -Most of the time, this configuration will work just fine. If you want to customize your Babel configuration (e.g. to add support for Flow), you can directly edit this file. For your changes to take effect, you need to restart the Docusaurus dev server. +Most of the time, the default preset configuration will work just fine. If you want to customize your Babel configuration (e.g. to add support for Flow), you can directly edit this file. For your changes to take effect, you need to restart the Docusaurus dev server.