Skip to content

Commit 4b3cf51

Browse files
committed
fix(@angular-devkit/build-webpack): service-worker should reject on error
This error is particularly recoverable.
1 parent d34b157 commit 4b3cf51

File tree

1 file changed

+4
-2
lines changed
  • packages/angular_devkit/build_webpack/src/angular-cli-files/utilities/service-worker

1 file changed

+4
-2
lines changed

packages/angular_devkit/build_webpack/src/angular-cli-files/utilities/service-worker/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ export function augmentAppWithServiceWorker(projectRoot: string, appRoot: string
8989
const configPath = path.resolve(appRoot, 'ngsw-config.json');
9090

9191
if (!fs.existsSync(configPath)) {
92-
throw new Error(oneLine`Error: Expected to find an ngsw-config.json configuration
92+
return Promise.reject(new Error(oneLine`
93+
Error: Expected to find an ngsw-config.json configuration
9394
file in the ${appRoot} folder. Either provide one or disable Service Worker
94-
in .angular-cli.json.`);
95+
in .angular-cli.json.`,
96+
));
9597
}
9698
const config = fs.readFileSync(configPath, 'utf8');
9799

0 commit comments

Comments
 (0)