Skip to content

Commit 534292f

Browse files
committed
fix(ng-packagr): create dist folder without error in certain rare cases
1 parent 7bc01b0 commit 534292f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

scopes/dev-services/compiler/ng-packagr/ng-packagr.compiler.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import removeFilesAndEmptyDirsRecursively
2222
import { Logger } from '@teambit/logger';
2323
import { NgccProcessor } from '@teambit/ngcc';
2424
import { Workspace, WorkspaceAspect } from '@teambit/workspace';
25-
import { existsSync, mkdirSync, writeFileSync } from 'fs-extra';
25+
import { mkdirsSync, writeFileSync } from 'fs-extra';
2626
import { join, posix, resolve } from 'path';
2727

2828
const ViewEngineTemplateError = `Cannot read property 'type' of null`;
@@ -214,9 +214,7 @@ export class NgPackagrCompiler implements Compiler {
214214
async transpileComponent(params: TranspileComponentParams): Promise<void> {
215215
// Create dist if it doesn't exist to avoid a warning with `bit status`
216216
const dist = join(params.outputDir, this.distDir);
217-
if (!existsSync(dist)) {
218-
mkdirSync(dist);
219-
}
217+
mkdirsSync(dist);
220218
// We do not need to compile using ng-packagr (except for builds) because Angular reads the source files directly
221219
return;
222220
/*const isApp = componentIsApp(params.component, this.application);

0 commit comments

Comments
 (0)