Skip to content

aleksailosey/nextjs-typescript-yarn-workspaces

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Next.js (with typescript and yarn workspaces)

Next.js (with typescript and yarn workspaces)

A simple example to help you get started with Next.js + typescript + yarn workspaces.

Getting started

$ cd nextjs-typescript-yarn-workspaces
$ yarn install
$ yarn workspace @project/web-app dev

Shameless plug

I am an indie hacker and I am running an uptime monitoring and analytics platform called WebGazer. Actually, this repository is the base of what I am using for WebGazer's frontend part.

Renaming for your project

I named the example workspace packages @project/components and @project/web-app. You can safely rename it to @my-awesome-project/components or something like that.

Custom types

The @types directory is for your custom global types. Since each Next.js application has to own a tsconfig.json of its own, these types are also included in packages/web-app/tsconfig.json.

"Where should I add custom @types packages?"

Since multiple packages can use the same typings, and it is very unlikely for different packages to depend on different versions of those typings, @types packages should go into devDependencies of the base package.json.

Running

Development

  1. Install dependencies

    $ yarn
  2. Start the web-app next.js application

    $ yarn workspace @project/web-app dev

    Then the application should be accessible on http://localhost:3000.

License

Copyright © 2020, Gökhan Sarı. Released under the MIT License.

About

A simple example to help you get started with Next.js + typescript + yarn workspaces.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 71.5%
  • JavaScript 22.0%
  • CSS 6.5%