Our re-usable TypeScript compiler configurations.
-
Install the config(s) you wish to use as devDependencies:
npm i -D @supportclass/tsconfig-base npm i -D @supportclass/tsconfig-nodecg-server npm i -D @supportclass/tsconfig-nodecg-client
-
Copy this boilerplate and save it as your project's
tsconfig.json
.{ // Can also be tsconfig-nodecg-server or tsconfig-nodecg-client "extends": "@supportclass/tsconfig-base", "compilerOptions": { "rootDir": "src", "outDir": "dist", "baseUrl": "./", "paths": { "*": [ "./node_modules/*", "./src/types/*" ] } }, "include": ["src/**/*.ts"], "exclude": ["src/**/*spec.ts"] }
-
Modify the boilerplate as-needed to fit your project's structure and unique needs.
Polymer 2 projects may also need this additional boilerplate configuration added to their tsconfig.json
:
{
"include": [
"../../types/browser.d.ts",
"bower_components/**/*.d.ts",
"dashboard/**/*.ts",
"graphics/**/*.ts",
"shared/**/*.ts"
]
}