- quickstart monorepo example for js/ts/react projects
-
tech-stack
- typescript v5
- npm workspaces
- rspack
- rspack config shared at top level with webpack-merge
- hot reloading ready
- jest for testing
- styling: support scss/css
- other devtools: eslint, prettier
-
project-structure
- packages
- foo: utils
- bar: depends on foo
- apps
- app-nodejs: simple nodejs utils
- app-react-rspack: simple react app
- packages
- requirements
- npm v7+
# build all packages
npm run build
# start demo app
cd apps/app-react-rspack
npm i
npm start
- open a browser and go to http://localhost:8999
APP_ENV
environment variable- if no value is set, building es6 and ts is supported, but not react
- if
react*
is set, building react is supported - if
reacthot
is set, react hot reloading is supported
- npm
npm run build
has to run twice because npm workspaces doesn't support pkg compiled by dependent order
- rspack
- esm-output is only supported in canary channel
- HMR is not implemented for module chunk format yet