Skip to content

Commit

Permalink
feat: add pwa'ness
Browse files Browse the repository at this point in the history
  • Loading branch information
Wassim CHEGHAM committed Apr 19, 2018
1 parent 461c386 commit 78c7eb8
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 4 deletions.
3 changes: 2 additions & 1 deletion angular.json
Expand Up @@ -52,7 +52,8 @@
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
"buildOptimizer": true,
"serviceWorker": true
}
}
},
Expand Down
27 changes: 27 additions & 0 deletions ngsw-config.json
@@ -0,0 +1,27 @@
{
"index": "/index.html",
"assetGroups": [{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html"
],
"versionedFiles": [
"/*.bundle.css",
"/*.bundle.js",
"/*.chunk.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
]
}
}]
}
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -35,7 +35,8 @@
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"rxjs": "^6.0.0-rc.0",
"zone.js": "^0.8.24"
"zone.js": "^0.8.24",
"@angular/service-worker": "^6.0.0-rc.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.5.0",
Expand All @@ -61,4 +62,4 @@
"tslint": "~5.9.1",
"typescript": "~2.7.2"
}
}
}
11 changes: 10 additions & 1 deletion src/app/app.module.ts
Expand Up @@ -6,10 +6,19 @@ import { HttpClientModule } from '@angular/common/http';
import { CoreModule } from '@app/core/core.module';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { ServiceWorkerModule } from '@angular/service-worker';
import { environment } from '../environments/environment';

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, HttpClientModule, BrowserAnimationsModule, CoreModule, AppRoutingModule],
imports: [
BrowserModule,
HttpClientModule,
BrowserAnimationsModule,
CoreModule,
AppRoutingModule,
ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production })
],
bootstrap: [AppComponent]
})
export class AppModule {}
Binary file added src/assets/icons/icon-128x128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon-144x144.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon-152x152.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon-192x192.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon-384x384.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon-512x512.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon-72x72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon-96x96.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions src/assets/manifest.json
@@ -0,0 +1,52 @@
{
"name": "Angular Search Experience",
"short_name": "angular-search",
"theme_color": "#975BCF",
"background_color": "#F25986",
"display": "fullscreen",
"Scope": "/",
"start_url": "/?utm_source=pwa",
"icons": [
{
"src": "assets/images/icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "assets/images/icons/icon-96x96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "assets/images/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "assets/images/icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "assets/images/icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png"
},
{
"src": "assets/images/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "assets/images/icons/icon-384x384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "assets/images/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"splash_pages": null
}
1 change: 1 addition & 0 deletions src/index.html
Expand Up @@ -8,6 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="manifest" href="assets/manifest.json">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style>
html,
Expand Down
6 changes: 6 additions & 0 deletions yarn.lock
Expand Up @@ -191,6 +191,12 @@
dependencies:
tslib "^1.9.0"

"@angular/service-worker@^6.0.0-rc.1":
version "6.0.0-rc.5"
resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-6.0.0-rc.5.tgz#f55f89a3012ae6e0bca21463a8fd538ae3425eac"
dependencies:
tslib "^1.9.0"

"@compodoc/compodoc@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@compodoc/compodoc/-/compodoc-1.1.2.tgz#6d038ff2be0fd01b12d669dcb08caf9709dfa14a"
Expand Down

0 comments on commit 78c7eb8

Please sign in to comment.