TypeScript configuration file for The Really Project, works for either browser or Node.js.
- TypeScript >= 4.1.3
- [Optional for browser] Node.js >= 14.15.3
- [Optional for browser] NPM >= 6.14.9 (NPM comes with Node.js so there is no need to install separately.)
# Install via NPM
$ npm install --save @reallyland/tsconfig
Note that the following fields are required after extending the sharable tsconfig
:
compilerOptions.rootDir
compilerOptions.outDir
compilerOptions.declarationDir
include
exclude
tsconfig.json
{
"extends": "@reallyland/tsconfig",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"declarationDir": "dist"
},
"include": ["src/**/*.ts"],
"exclude": ["dist"]
}
[Optional] tsconfig.prod.json
{
"extends": "@reallyland/tsconfig",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"declarationDir": "dist"
},
"include": ["src/*.ts"],
"exclude": ["src/test/**/*.ts", "src/demo/**/*.ts"]
}
Main difference is that there are dom
and dom.iterable
are added in the lib
field of /browser/tsconfig.json
to provide typings for web platform APIs.
tsconfig.json
{
"extends": "@reallyland/tsconfig/browser",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"declarationDir": "dist"
},
"include": ["src/**/*.ts"],
"exclude": ["dist"]
}
MIT License © Rong Sen Ng (motss)