https://github.com/bnaya/ts-composite-babel-loader-webpack
Example project how to setup babel to build your typescript with project references, and keep good DX
https://github.com/bnaya/ts-composite-babel-loader-webpack
Last synced: 12 days ago
JSON representation
Example project how to setup babel to build your typescript with project references, and keep good DX
- Host: GitHub
- URL: https://github.com/bnaya/ts-composite-babel-loader-webpack
- Owner: Bnaya
- Created: 2019-10-20T20:44:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T23:05:02.000Z (over 2 years ago)
- Last Synced: 2025-05-07T22:09:43.330Z (12 days ago)
- Language: TypeScript
- Homepage:
- Size: 342 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# typescript project references + webpack via **babel**
Using `babel-loader` and not `ts-loader`. ts-loader has built-in support for project references.
## Motivation
CRA issue [#7807](https://github.com/facebook/create-react-app/issues/7807)
## Info
No typechecking via webpack plugin. `fork-ts-checker-webpack-plugin` doesn't support project refs yet [#328](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/328).
use `yarn typecheck` that uses `tsc` under the hood.
## The project includes 4 packages
* `target1` - the package we build with webpack, that imports code from the other packages.
* `common` - the files layout is optimal for no-build editing experience. vscode knowns to pick the typescript sources. but has specific layout. can't have `outdir`
* `utils` - same as `common`, just to add another level of deps
* `withdist` - another approach, with caveats. mostly no no-build editing experience. but we can have `outDir`Read [packages/target1/src/index.ts](./packages/target1/src/index.ts) for additional info