Rollup Typescript2 example for reproduce problem with typescript project references
Why rollup-typescript2? — because @rollup/plugin-typescript doesn't support typescript project references
Why you need SDK project — in this example, sdk - externalized project. But it also dogfooded from local project frontend
Why you need shared project — because it shared with backend
, frontend
, and sdk. It shared project with some models and internals. Optimize backend
compilation speed and avoid direct sdk usage in backend
\
- Run
npm run -w @project/sdk rollup
- See
build/sdk
andbuild/shared
directoriesIt contains types with SRC directorytree packages/sdk/build/shared packages/sdk/build/shared └── src └── test ├── util.d.ts └── util.d.ts.map tree packages/sdk/build/sdk packages/sdk/build/sdk └── src ├── actions │ ├── create.d.ts │ └── create.d.ts.map └── models ├── user.d.ts └── user.d.ts.map
- Run
npm run -w @project/sdk build
and as a result - all typing located in actions and models directories. Additional sdk and shared dirs didn't create