In my project, I have the following scripts section in the package.json
:
"watch": "?",
"build": "npm run build:compactor && npm run build:generator && npm run build:cleaner",
"build:lambda": "npm run build:compactor:lambda && npm run build:generator:lambda && npm run build:cleaner:lambda",
"build:compactor": "tsc -p src/compactor",
"build:generator": "tsc -p src/generator",
"build:cleaner": "tsc -p src/cleaner",
"build:compactor:lambda": "npm run build:compactor && cp package.json ./dist-compactor/package.json && cd ./dist-compactor && npm install --production && zip -r ../dist-compactor.zip *",
"build:generator:lambda": "npm run build:generator && cp package.json ./dist-generator/package.json && cd ./dist-generator && npm install --production && zip -r ../dist-compactor.zip *",
"build:cleaner:lambda": "npm run build:cleaner && cp package.json ./dist-cleaner/package.json && cd ./dist-cleaner && npm install --production && zip -r ../dist-compactor.zip *",
My project is divided into 3 subprojects, each with its own configuration file that extends the main tsconfig.json
.
Running tsc -w
by itself will not consider the nested configurations.
I could run tsc -p src/<project> -w
concurrently 3 times, but perhaps there's a built-in way in tsc
to handle this more efficiently?