Itay.B
Itay.B

Reputation: 4119

Typescript compile files from few source folders

I have 3 NodeJs apps with Typescript code (latest versions). In each one of the apps there is an "src" folder which contains the ts code files and a "dist" folder that contains the js files compiled by Typescript. Now I want to create outside of these apps folders a "common" folder that will contain few ts files that each one of my 3 apps can use and it should be compiled to the "dist" folder of each app separately. Instead of using "rootDir": "./src" I tried using "rootDirs":["../../common", "/.src"] but it didn't work.

Upvotes: 0

Views: 190

Answers (1)

Khai
Khai

Reputation: 352

Sounds like you want to create workspaces. The package manager you use should have support for workspaces built-in. Like Yarn Workspaces or NPM workspaces.

Upvotes: 2

Related Questions