A simple example to help you get started with Next.js + typescript + yarn workspaces.
$ cd nextjs-typescript-yarn-workspaces
$ yarn install
$ yarn workspace @project/web-app dev
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.
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.
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.
-
Install dependencies
$ yarn
-
Start the web-app next.js application
$ yarn workspace @project/web-app dev
Then the application should be accessible on http://localhost:3000.
I am an indie hacker, and I am running two services that might be useful for your business. Check them out :)
WebGazer is a monitoring service that checks your website, cron jobs, or scheduled tasks on a regular basis. It notifies you with instant alerts in case of a problem. That way, you have peace of mind about the status of your service without manually checking it.
PoeticMetric is a privacy-first, regulation-compliant, blazingly fast analytics tool.
No cookies or personal data collection. So you don't have to worry about cookie banners or GDPR, CCPA, and PECR compliance.
Copyright © 2020, Gökhan Sarı. Released under the MIT License.