πŸ™‰πŸ™‰ TypeScript@3 monorepo example next.js version
Branch: master
Clone or download
Latest commit 2fbf6e3 Aug 15, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets πŸ™‰πŸ™‰ Aug 15, 2018
packages πŸ™‰πŸ™‰ Aug 15, 2018
.gitignore πŸ™‰πŸ™‰ Aug 15, 2018
README.md πŸ™‰πŸ™‰ Aug 15, 2018
package.json πŸ™‰πŸ™‰ Aug 15, 2018
yarn.lock πŸ™‰πŸ™‰ Aug 15, 2018

README.md

typescript-monorepo-next-example

<ComponentA>

πŸ™‰πŸ™‰ TypeScript Monorepo Sample
Required TypeScript@3 above

Create monorepo with next.js

Prerequisition

yarn

Create monorepo

$ mkdir typescript-monorepo && cd $_
$ yarn init -y -p
$ mkdir -p packages/app && cd $_
$ yarn init -y
$ yarn add -D typescript @types/react
$ yarn add next react react-dom @zeit/next-typescript
$ mkdir pages
$ touch pages/index.tsx next.config.js .babelrc.js tsconfig.json
$ cd ../.. # change root directory

Configure typescript monorepo

Create component

$ mkdir -p packages/component-a && cd $_
$ yarn init -y
$ yarn add -D typescript @types/react
$ yarn add react
$ touch index.tsx tsconfig.json
$ cd ../.. # change root directory
$ yarn
$ yarn build:packages # or yarn build:packages:watch
$ yarn start

Related