Got a monorepo where I want to use some default tsconfig settings.
My current attempt looks like
tsconfig.base.json
{
"compilerOptions": {
// Target ECMAScript version (es6, es7, etc.)
"target": "es6",
// Output module type (commonjs, es2015, etc.)
// When targeting Node.js or a server-side environment, set to 'commonjs' for compatibility.
// For modern web browsers, consider setting to one of the newer module systems like ES2015/ESNext.
"module": "commonjs",
// Enables source map generation: helps debugging by mapping compiled JavaScript to original TypeScript code
"sourceMap": true,
// Generate *.d.ts files that contain the type definitions for your project
"declaration": true,
// Enables declaration map generation: maps generated .d.ts files back to their original TypeScript source files
"declarationMap": true,
// Enables all strict modes, like no implicit any, to functions without return types, and more.
"strict": true,
// Allows ES6 modules to be imported as CommonJS modules
"esModuleInterop": true,
// Allows synthetic default imports from non-Babel code
"allowSyntheticDefaultImports": true,
// Avoids TypeScript from looking into node_modules when checking types, improving performance.
"skipLibCheck": true,
},
"exclude": ["**/node_modules/**/*"] // Avoids TypeScript from looking into node_modules when checking types, improving performance.
}
app/tsconfig.json
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "."
}
}
functions/tsconfig.json
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"target": "es2017",
"sourceMap": false,
"outDir": "lib"
},
"compileOnSave": true,
"include": ["src/**/*", "scripts/utils.ts"],
"exclude": ["node_modules", "lib"]
}
Is this the correct way?
(do I need to set root
in each of the dirs as well?)