feat(js): add srcRootForCompilationRoot option to tsc executor (#10707)

* feat(js): add `srcRootForCompilationRoot` option to tsc executor

ISSUES CLOSED: #9410

* docs(js): add description for `srcRootForCompilationRoot` option
This commit is contained in:
Nozomu Miyamoto 2022-09-12 22:14:23 +09:00 committed by GitHub
parent d782a694f4
commit aa01b7bd2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 0 deletions

View File

@ -305,6 +305,10 @@
"description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.",
"enum": ["dependencies", "peerDependencies"],
"default": "peerDependencies"
},
"srcRootForCompilationRoot": {
"type": "string",
"description": "Sets the rootDir for TypeScript compilation. When not defined, it uses the project's root property"
}
},
"required": ["main", "outputPath", "tsConfig"],

View File

@ -57,6 +57,10 @@
"description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.",
"enum": ["dependencies", "peerDependencies"],
"default": "peerDependencies"
},
"srcRootForCompilationRoot": {
"type": "string",
"description": "Sets the rootDir for TypeScript compilation. When not defined, it uses the project's root property"
}
},
"required": ["main", "outputPath", "tsConfig"],

View File

@ -42,6 +42,7 @@ export interface ExecutorOptions {
transformers: TransformerEntry[];
updateBuildableProjectDepsInPackageJson?: boolean;
buildableProjectDepsInPackageJsonType?: 'dependencies' | 'peerDependencies';
srcRootForCompilationRoot?: string;
}
export interface NormalizedExecutorOptions extends ExecutorOptions {

View File

@ -54,6 +54,7 @@ export async function* compileTypeScriptFiles(
outputPath: normalizedOptions.outputPath,
projectName: context.projectName,
projectRoot: normalizedOptions.projectRoot,
rootDir: normalizedOptions.srcRootForCompilationRoot,
tsConfig: normalizedOptions.tsConfig,
watch: normalizedOptions.watch,
deleteOutputPath: normalizedOptions.clean,