Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Future Suggestion] Use TypeScript Project References #203

Open
Bnaya opened this issue Feb 16, 2020 · 1 comment
Open

[Future Suggestion] Use TypeScript Project References #203

Bnaya opened this issue Feb 16, 2020 · 1 comment

Comments

@Bnaya
Copy link
Contributor

Bnaya commented Feb 16, 2020

** I've opened this issue for future reference **

Since 3.0, TypeScript has a feature called Project References
https://www.typescriptlang.org/docs/handbook/project-references.html

That's allow to build multiple related typescript packages with separate tsconfig's using one tsc --build command, and more DX improvements

The main cons is: It uses only one cpu core, and the overall build speed of the entire monorepo will get longer. After some tests on umbrella codebase - it's really meaningful.
There's an issue for that on TypeScript repo to track that:
Support multi-threaded compilation for --build

An intermediate step can a mesh build setup, But i think it's gonna be complicated to configure it correctly

@postspectacular
Copy link
Member

Hi @Bnaya - could you please share some of your tests with this repo somewhere? I've attempted using project refs twice in the past and always ran into one or more stumbling blocks / unable to build all packages. IIRC one of the main problems is the multi format output via the bundle-module script (via rollup). Currently, all packages in the repo are configured for TS to emit ES6 modules, which are then transpiled via said script to CJS/UMD formats...

Maybe with a better integration of ts-node in my dev workflow (e.g. via additional script aliases in the package.json files) the CJS versions aren't needed anymore until it comes to building a release. I've started using it more recently, but I still seem to require additional tsconfig.json files to set "module": "commonjs" for that purpose...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants