Skip to content

Commit

Permalink
fix(angular): Quit process after finishing a static build
Browse files Browse the repository at this point in the history
I don't understand why `process.exit` is needed for this particular case
but it seems to fix the issue.

In order to be more safe, I also added a `try`/`catch` and in my own
testing that caught a ngcc locking issue I would have missed otherwise.

Closes #15227.
  • Loading branch information
bebraw committed Jul 5, 2021
1 parent 9f711a9 commit 5a8fcf8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/angular/src/server/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
import { buildStatic } from '@storybook/core/server';
import { logger } from '@storybook/node-logger';
import options from './options';

buildStatic(options);
async function build() {
try {
await buildStatic(options);

// #15227
process.exit(0);
} catch (error) {
logger.error(error);
}
}

build();

0 comments on commit 5a8fcf8

Please sign in to comment.