From 60df28641f2987cec0fce6cfadf5246b0e847073 Mon Sep 17 00:00:00 2001 From: Emrin Date: Sun, 30 Jan 2022 09:57:14 +0100 Subject: [PATCH 1/2] fix: documentation / typescript Update outdated TS/TSX compiler information. --- docs/basic-features/typescript.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/basic-features/typescript.md b/docs/basic-features/typescript.md index f56028f7fe5f557..b0326ae64931d83 100644 --- a/docs/basic-features/typescript.md +++ b/docs/basic-features/typescript.md @@ -37,7 +37,9 @@ Next.js will automatically configure this file with default values. Providing yo You can also provide a relative path to a tsconfig.json file by setting `typescript.tsconfigPath` prop inside your `next.config.js` file. -> Next.js uses Babel to handle TypeScript, which has some [caveats](https://babeljs.io/docs/en/babel-plugin-transform-typescript#caveats), and some [compiler options are handled differently](https://babeljs.io/docs/en/babel-plugin-transform-typescript#typescript-compiler-options). +Next.js will by default use [Rust SWC](https://nextjs.org/docs/advanced-features/compiler) to compile TypeScript and TSX, resulting in a much faster build time. + +> Next.js will use Babel to handle TypeScript if `.babelrc` is present, this has some [caveats](https://babeljs.io/docs/en/babel-plugin-transform-typescript#caveats), and some [compiler options are handled differently](https://babeljs.io/docs/en/babel-plugin-transform-typescript#typescript-compiler-options). Then, run `next` (normally `npm run dev` or `yarn dev`) and Next.js will guide you through the installation of the required packages to finish the setup: From d74fb5d51867a7b273f58fc717a0323946ff84eb Mon Sep 17 00:00:00 2001 From: Lee Robinson Date: Sun, 30 Jan 2022 11:23:46 -0600 Subject: [PATCH 2/2] Apply suggestions from code review --- docs/basic-features/typescript.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/basic-features/typescript.md b/docs/basic-features/typescript.md index b0326ae64931d83..db23d29dad0730b 100644 --- a/docs/basic-features/typescript.md +++ b/docs/basic-features/typescript.md @@ -37,9 +37,9 @@ Next.js will automatically configure this file with default values. Providing yo You can also provide a relative path to a tsconfig.json file by setting `typescript.tsconfigPath` prop inside your `next.config.js` file. -Next.js will by default use [Rust SWC](https://nextjs.org/docs/advanced-features/compiler) to compile TypeScript and TSX, resulting in a much faster build time. +Starting in `v12.0.0`, Next.js uses [SWC](https://nextjs.org/docs/advanced-features/compiler) by default to compile TypeScript and TSX for faster builds. -> Next.js will use Babel to handle TypeScript if `.babelrc` is present, this has some [caveats](https://babeljs.io/docs/en/babel-plugin-transform-typescript#caveats), and some [compiler options are handled differently](https://babeljs.io/docs/en/babel-plugin-transform-typescript#typescript-compiler-options). +> Next.js will use Babel to handle TypeScript if `.babelrc` is present. This has some [caveats](https://babeljs.io/docs/en/babel-plugin-transform-typescript#caveats) and some [compiler options are handled differently](https://babeljs.io/docs/en/babel-plugin-transform-typescript#typescript-compiler-options). Then, run `next` (normally `npm run dev` or `yarn dev`) and Next.js will guide you through the installation of the required packages to finish the setup: