-
Notifications
You must be signed in to change notification settings - Fork 5
Local Development Environment
This document outlines how to setup your local development environment when working in the DAOhaus Rage and Sage Monorepos. Another goal is to provide clear steps for leveraging nx
to generate new apps so that folks have what's needed to spin up experiments.
Our monorepos use Nx as a build system and for scaffolding.
npm install -g nx
This is split up by package. We've created generators that leverage nx
with predetermined option flags.
Our stack uses Vite as our React build tool. This generator will scaffold a new React app, such as a frontend app, using vite
and styled-components
.
nx g @nxext/react:application --name <name of app> --pascalCaseFiles true --routing true --style styled-components
TypeScript is enabled and included by default.
Our stack uses Vite as our React build tool. This generator will scaffold a new React library (such as a component library) with vite
and styled-components
.
nx g @nxext/react:library --name here --importPath @daohaus/<package_name> --buildable true --publishable true --style styled-components
TypeScript is enabled and included by default.
Notes:
- use the --publishable
flag for external libraries
- use the --buildable
flag for internal libraries
nx g @nrwl/js:lib <lib_name> --importPath @daohaus/<package_name> --publishable true
Notes:
- use the --publishable
flag for external libraries
- use the --buildable
flag for internal libraries
nx g @nrwl/node:application <app_name>
nx generate @ns3/nx-serverless:app <name> --plugin @ns3/nx-serverless/plugin
- Sometimes vite applications will have trouble finding dependencies with a depth greater than 1. To resolve this create a custom vite config like the one mentioned in this issue, and update the build and serve commands in the project.json to point to the new vite config path. Now your issues should be resolved.