fix(core): ensure project configuration is saved as standalone when workspace.json isn't present(#12823)

Project configuration should be saved as standalone when addProject is called on an ng cli workspace if worksapce.json isn't present.
This commit is contained in:
Nathan Walker 2022-10-26 09:10:40 -07:00 committed by GitHub
parent 6e97c6c2e5
commit e1e188c84e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -507,6 +507,9 @@ export class NxScopedHost extends virtualFs.ScopedHost<any> {
};
const projects: [string, any][] = Object.entries(configToWrite.projects);
for (const [project, projectConfig] of projects) {
if (!workspaceFileName) {
projectConfig.configFilePath ??= `${projectConfig.root}/project.json`;
}
if (projectConfig.configFilePath) {
if (workspaceFileName && !isNewFormat) {
throw new Error(