From 920b3d259d47f60994b62d766fd9ebd89602e4dc Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Fri, 10 Mar 2017 14:05:29 -0800 Subject: [PATCH] feat(aio): support @angular/service-worker using the CLI generated service worker manifest (#15042) --- aio/.angular-cli.json | 1 + aio/ngsw-manifest.json | 24 ++++++++++++++++++++++++ aio/package.json | 1 + aio/yarn.lock | 13 ++++++++++++- 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 aio/ngsw-manifest.json diff --git a/aio/.angular-cli.json b/aio/.angular-cli.json index 57a6fab8d2..e186f290ac 100644 --- a/aio/.angular-cli.json +++ b/aio/.angular-cli.json @@ -19,6 +19,7 @@ "test": "test.ts", "tsconfig": "tsconfig.json", "prefix": "aio", + "serviceWorker": true, "styles": [ "styles.scss" ], diff --git a/aio/ngsw-manifest.json b/aio/ngsw-manifest.json new file mode 100644 index 0000000000..6e15884792 --- /dev/null +++ b/aio/ngsw-manifest.json @@ -0,0 +1,24 @@ +{ + "static.ignore": [ + "\\.js\\.map$", + "^\/assets\/images\/(bios|cookbooks|devguide|examples)\/", + "^\/content\/docs\/.*\/" + ], + "routing": { + "index": "/index.html", + "routes": { + "/": { + "prefix": false + }, + "/about": { + "prefix": true + }, + "/tutorial": { + "prefix": true + }, + "/guide": { + "prefix": true + } + } + } +} diff --git a/aio/package.json b/aio/package.json index 4fc8211f6c..25efaeb833 100644 --- a/aio/package.json +++ b/aio/package.json @@ -35,6 +35,7 @@ "@angular/platform-browser-dynamic": "next", "@angular/platform-server": "next", "@angular/router": "next", + "@angular/service-worker": "^1.0.0-beta.6", "core-js": "^2.4.1", "rxjs": "^5.1.0", "ts-helpers": "^1.1.1", diff --git a/aio/yarn.lock b/aio/yarn.lock index 054aee599f..6ae4b5ef01 100644 --- a/aio/yarn.lock +++ b/aio/yarn.lock @@ -124,6 +124,13 @@ version "4.0.0-rc.2" resolved "https://registry.yarnpkg.com/@angular/router/-/router-4.0.0-rc.2.tgz#66fc5be012caa38441314d0a0b9c9b6a723c471a" +"@angular/service-worker@^1.0.0-beta.6": + version "1.0.0-beta.6" + resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-1.0.0-beta.6.tgz#ae3ca0b43ab1cbd572a191b2ef3e1b787f71ed1e" + dependencies: + base64-js "^1.1.2" + jshashes "^1.0.5" + "@angular/tsc-wrapped@4.0.0-rc.2", "@angular/tsc-wrapped@>=0.5.0 <5.0.0 || >=4.0.0-beta <5.0.0": version "4.0.0-rc.2" resolved "https://registry.yarnpkg.com/@angular/tsc-wrapped/-/tsc-wrapped-4.0.0-rc.2.tgz#d7023d93f4576b6f776ffc7175ff760e7e133705" @@ -548,7 +555,7 @@ base64-arraybuffer@0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" -base64-js@^1.0.2: +base64-js@^1.0.2, base64-js@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1" @@ -3339,6 +3346,10 @@ jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" +jshashes@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/jshashes/-/jshashes-1.0.6.tgz#b04eb4ae8f9987b2d3ce00a6337c120543949bfd" + json-loader@^0.5.4: version "0.5.4" resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.4.tgz#8baa1365a632f58a3c46d20175fc6002c96e37de"