Skip to content

Basic typescript template with references, composite with npm workspaces

Notifications You must be signed in to change notification settings

lalilaloe/workspaces-references-typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

workspaces-references-test

In this example we combine npm workspaces and Typescript project references to "structure your TypeScript programs into smaller pieces"

Usage

This is a barebones template, you can simply test it using:

npm run build
npm start

Project references

Normally you would use tsc as build script, with project references keep in mind that you need to use tsc --build or tsc -b in order to include references. The composite property in tsconfig, defines the root of your package/module.

Workspaces

Using workspaces unlocks some features that you can benifit from. For example to run scoped scripts npm run test --workspace=backend. You can also scope your packages, for example npm init --scope @app -w ./libs then you can use @app/libs to import for example. Read more on workspaces at workspaces docs

About

Basic typescript template with references, composite with npm workspaces

Topics

Resources

Stars

Watchers

Forks