@repodog/ts-config
v5.0.4
Published
The Repodog Typescript config module.
Downloads
52
Readme
@repodog/ts-config
The Repodog tsconfig.
Install package and peer dependency
# terminal
npm install @repodog/ts-config typescript --save-dev
Use package
Configure
Project root
If you are building the project from the root.
// tsconfig.json
{
"extends": "@repodog/ts-config/index.json",
"include": [
"src/**/*"
]
}
// tsconfig.build.json
{
"extends": ["./tsconfig.json", "@repodog/ts-config/build.json"],
"compilerOptions": {
"outDir": "dist/types",
"rootDir": "src"
},
"exclude": [
"**/*.test.*"
]
}
Workspace root
If you are building the project from each workspace root.
// tsconfig.json
{
"extends": "@repodog/ts-config/index.json",
"include": [
"packages/**/*"
]
}
// <workspace>/tsconfig.json
{
"extends": ["@repodog/ts-config/index.json", "@repodog/ts-config/build.json"],
"include": [
"src/**/*"
],
"references": []
}
// <workspace>/tsconfig.build.json
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist/types",
"rootDir": "src"
},
"exclude": [
"**/*.test.*"
]
}
Execute
// package.json
{
"scripts": {
"compile:types": "tsc --project ./tsconfig.build.json",
"type-check": "tsc --noEmit"
}
}