Skip to content

Commit e7f5488

Browse files
Broccohansl
authored andcommitted
fix(@schematics/angular): Update update logic to set service worker configuration
1 parent 7a627b4 commit e7f5488

File tree

1 file changed

+9
-1
lines changed
  • packages/schematics/angular/migrations/update-6

1 file changed

+9
-1
lines changed

packages/schematics/angular/migrations/update-6/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,14 @@ function extractProjectsConfig(config: CliConfig, tree: Tree): JsonObject {
273273
configurationName = environment;
274274
}
275275

276+
let swConfig: JsonObject | null = null;
277+
if (serviceWorker) {
278+
swConfig = {
279+
serviceWorker: true,
280+
ngswConfigPath: '/src/ngsw-config.json',
281+
};
282+
}
283+
276284
acc[configurationName] = {
277285
...(isProduction
278286
? {
@@ -288,7 +296,7 @@ function extractProjectsConfig(config: CliConfig, tree: Tree): JsonObject {
288296
}
289297
: {}
290298
),
291-
...(isProduction && serviceWorker ? { serviceWorker: true } : {}),
299+
...(isProduction && swConfig ? swConfig : {}),
292300
fileReplacements: [
293301
{
294302
replace: `${app.root}/${source}`,

0 commit comments

Comments
 (0)