Turbo config
Configuring Turbo for FastAPI, Next.js and Turborepo.
Introduction
This project was first created using the create-turbo
npm package:
Changes to the official Turbo starter
The official Turbo starter is a great starting point for a monorepo, but it has some configurations I did not need. As I will not be sharing code between the backend and frontend (nor the docs), I have removed the packages/ui
directory.
If you want to add a new package to the project, please reference the official documentation.
For quick reference:
- Create a new folder in
packages/<folder>
- Add a
package.json
, withname
andtypes
pointing atsrc/index.ts[x]
- Add
src/index.ts[x]
, with at least one named export - Install your packages from
root
Turbo.json
The currently configured turbo.json
does not have many changes from the official starter. The only change is the addition of the globalEnv
key.
Without adding these environment variables to the globalEnv
, you will receive an eslint error when referencing variables in your .env
, however, your code will still work.
There are different ways that people solve this. While it’s possible to use
"globalDependencies": ["**/.env"]
, that did not work in this project.\
Was this page helpful?