File tree 4 files changed +12
-1
lines changed
packages/angular_devkit/build_angular/src
angular-cli-files/utilities/service-worker 4 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ export function augmentAppWithServiceWorker(
94
94
appRoot : Path ,
95
95
outputPath : Path ,
96
96
baseHref : string ,
97
+ ngswConfigPath ?: string ,
97
98
) : Promise < void > {
98
99
// Path to the worker script itself.
99
100
const distPath = normalize ( outputPath ) ;
@@ -105,7 +106,7 @@ export function augmentAppWithServiceWorker(
105
106
'@angular/service-worker/config' ,
106
107
) ;
107
108
const safetyPath = join ( dirname ( workerPath ) , 'safety-worker.js' ) ;
108
- const configPath = join ( appRoot , 'ngsw-config.json' ) ;
109
+ const configPath = ngswConfigPath as Path || join ( appRoot , 'ngsw-config.json' ) ;
109
110
110
111
return host . exists ( configPath ) . pipe (
111
112
switchMap ( exists => {
Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ export class BrowserBuilder implements Builder<BrowserBuilderSchema> {
111
111
projectRoot ,
112
112
resolve ( root , normalize ( options . outputPath ) ) ,
113
113
options . baseHref || '/' ,
114
+ options . ngswConfigPath ,
114
115
) . then (
115
116
( ) => {
116
117
obs . next ( { success : ! stats . hasErrors ( ) } ) ;
Original file line number Diff line number Diff line change @@ -181,6 +181,11 @@ export interface BrowserBuilderSchema {
181
181
*/
182
182
serviceWorker : boolean ;
183
183
184
+ /**
185
+ * Path to ngsw-config.json.
186
+ */
187
+ ngswConfigPath ?: string ;
188
+
184
189
/**
185
190
* Flag to prevent building an app shell.
186
191
*/
Original file line number Diff line number Diff line change 194
194
"description" : " Generates a service worker config for production builds." ,
195
195
"default" : false
196
196
},
197
+ "ngswConfigPath" : {
198
+ "type" : " string" ,
199
+ "description" : " Path to ngsw-config.json."
200
+ },
197
201
"skipAppShell" : {
198
202
"type" : " boolean" ,
199
203
"description" : " Flag to prevent building an app shell." ,
You can’t perform that action at this time.
0 commit comments