UNPKG

@berenddeboer/nx-aws-cdk

Version:

Nx self-inferring plugin for AWS CDK stacks

65 lines 2.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createTsConfig = createTsConfig; const devkit_1 = require("@nx/devkit"); const shared = require("@nx/js/src/utils/typescript/create-ts-config"); function createTsConfig(host, options, relativePathToRootTsConfig) { createAppTsConfig(host, options); const json = { files: [], references: [ { path: "./tsconfig.app.json", }, ], }; if (options.unitTestRunner !== "none") { json.references?.push({ path: "./tsconfig.spec.json", }); } // inline tsconfig.base.json into the project if (options.rootProject) { json.compileOnSave = false; json.compilerOptions = { ...shared.tsConfigBaseOptions, ...json.compilerOptions, }; json.exclude = ["node_modules", "tmp", "cdk.out"]; } else { json.extends = relativePathToRootTsConfig; } (0, devkit_1.writeJson)(host, `${options.projectRoot}/tsconfig.json`, json); } function createAppTsConfig(host, options) { const json = { extends: "./tsconfig.json", compilerOptions: { composite: true, // What CDK generates by default. Not sure this is what we want in nx. target: "ES2020", module: "commonjs", moduleResolution: "node", lib: ["es2020", "dom"], declaration: true, strict: true, noImplicitAny: true, strictNullChecks: true, noImplicitThis: true, alwaysStrict: true, noUnusedLocals: false, noUnusedParameters: false, noImplicitReturns: true, noFallthroughCasesInSwitch: false, inlineSourceMap: true, inlineSources: true, experimentalDecorators: true, strictPropertyInitialization: false, }, include: ["src/**/*"], exclude: [], }; (0, devkit_1.writeJson)(host, `${options.projectRoot}/tsconfig.app.json`, json); } //# sourceMappingURL=create-ts-config.js.map