Breaking down TypeScript project references

Interoperability with other tools

Why not ts-jest/ts-loader

The moving parts

1. Create a solution tsconfig.json

2. Create tsconfig.base.json

2. Introduce tsconfig.settings.json

3. Add project tsconfig’s

4. Setup linting to not type check

5. Configure babel-jest

6. Create/update package.json for libraries

{
name: '@my-company/lib-name,
version: '0.0.1',
main: 'dist/index.js'
}

7. Add project references between referenced libraries

"references": [
{ "path": "../my-library" }
]
{
"dependencies": {
"@my-org/my-library": "0.0.1"
}
}
"paths": {
"@my-org/my-library": "./lib/my-library/src/index.ts"
}

Application setup

Wrapping up

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jake Ginnivan

Jake Ginnivan

Co-Founder featureboard.app | Principal Consultant arkahna.io | Previously Tech Lead Seven West Media WA | International Speaker | OSS | Mentor