fix(core): fix remove generator for custom layout (#5921)

This commit is contained in:
Noriyuki Shinpuku 2021-06-12 08:06:59 +09:00 committed by GitHub
parent 5b2e594b62
commit a0b2df5395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,13 +16,17 @@ export function updateTsconfig(
schema: Schema,
project: ProjectConfiguration
) {
const { npmScope } = getWorkspaceLayout(tree);
const { appsDir, libsDir, npmScope } = getWorkspaceLayout(tree);
const tsConfigPath = 'tsconfig.base.json';
if (tree.exists(tsConfigPath)) {
updateJson(tree, tsConfigPath, (json) => {
delete json.compilerOptions.paths[
`@${npmScope}/${project.root.substr(5)}`
`@${npmScope}/${project.root.substr(
project.projectType === 'application'
? appsDir.length + 1
: libsDir.length + 1
)}`
];
return json;