How to use the @angular-devkit/build-angular/src/angular-cli-files/utilities/service-worker.augmentAppWithServiceWorker function in @angular-devkit/build-angular

To help you get started, we’ve selected a few @angular-devkit/build-angular examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enten / udk / angular / lib / build / ng-devkit.ts View on Github external
// transforms.indexHtml,
              undefined,
              // i18nLocale is used when Ivy is disabled
              locale || options.i18nLocale,
              localeBaseHref || options.baseHref,
            );
          } catch (err) {
            return finalize(false, mapErrorToMessage(err));
          }
        }
      }

      if (!options.watch && options.serviceWorker) {
        for (const outputPath of outputPaths.values()) {
          try {
            await augmentAppWithServiceWorker(
              host,
              root,
              normalize(projectRoot),
              normalize(outputPath),
              options.baseHref || '/',
              options.ngswConfigPath,
            );
          } catch (err) {
            return finalize(false, mapErrorToMessage(err));
          }
        }
      }
    }

    return finalize(success);
  };
github enten / udk / angular / lib / udk-builder.js View on Github external
return new Observable(obs => {
            augmentAppWithServiceWorker(
              this.context.host,
              root,
              projectRoot,
              resolve(root, normalize(options.outputPath)),
              options.baseHref || '/',
              options.ngswConfigPath
            ).then(
              () => {
                obs.next({ success: true });
                obs.complete();
              },
              (err) => {
                obs.error(err);
              }
            );
          });
github just-jeb / electron-angular-native / custom-builders / src / custom-webpack / index.ts View on Github external
return new Observable(obs => {
            augmentAppWithServiceWorker(
              this.context.host,
              root,
              projectRoot,
              resolve(root, normalize(options.outputPath)),
              options.baseHref || '/',
              options.ngswConfigPath,
            ).then(
              () => {
                obs.next({ success: true });
                obs.complete();
              },
              (err: Error) => {
                obs.error(err);
              },
            );
          });

@angular-devkit/build-angular

Angular Webpack Build Facade

MIT
Latest version published 3 days ago

Package Health Score

100 / 100
Full package analysis

Popular @angular-devkit/build-angular functions