Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 1.45 KB

File metadata and controls

39 lines (24 loc) · 1.45 KB

Deploy to now

TypeScript Next.js example

This is a really simple project that show the usage of:

How to use it?

Clone git@github.com:rsomlette/next-practice.git

--OR--

Download manually

Download the example:

cd next-practice

Install it and run it with:

yarn install
yarn dev

The idea behind the example

Use the @zeit/next-typescript plugin to inject @babel/preset-typescript into Next.js, allowing for fast TypeScript transpilation. It also implements a tsconfig.json as recommended by the @zeit/next-typescript plugin page.

A type-check script is also added to package.json, which runs TypeScript's tsc CLI in noEmit mode to run type-checking separately. You can then include this in your test scripts, say, for your CI process.

Cons:

The project isn't using typescript compiler. Therefore as quoted above only your IDE or the script yarn tsc will provide typescript errors.