diff --git a/angular-cli.json b/angular-cli.json index 7e1d7ea..16072eb 100644 --- a/angular-cli.json +++ b/angular-cli.json @@ -9,6 +9,7 @@ "outDir": "dist", "assets": [ "assets", + "manifest.json", "favicon.ico" ], "index": "index.html", diff --git a/package.json b/package.json index e78a04f..d6f9385 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "scripts": { "start": "pm2 start process.json --only qedu-provas-front --no-daemon", "start:dev": "ng serve", - "build:stag": "ng build --env=stag --aot=true", - "build:prod": "ng build --env=prod --aot=true", + "build:stag": "ng build --env=stag --aot=true --output-hashing=bundle && sw-precache --verbose --config sw-precache.conf.js", + "build:prod": "ng build --env=prod --aot=true --output-hashing=bundle && sw-precache --verbose --config sw-precache.conf.js", "lint": "tslint \"src/**/*.ts\"", "test": "ng test", "pree2e": "webdriver-manager update", @@ -56,6 +56,7 @@ "karma-remap-istanbul": "^0.6.0", "nodemon": "^1.11.0", "protractor": "~5.1.1", + "sw-precache": "^5.2.0", "ts-node": "2.1.0", "tslint": "^4.3.0", "typescript": "~2.2.1", diff --git a/src/assets/images/android-chrome-192x192.png b/src/assets/images/android-chrome-192x192.png new file mode 100644 index 0000000..08cd3af Binary files /dev/null and b/src/assets/images/android-chrome-192x192.png differ diff --git a/src/assets/images/android-chrome-512x512.png b/src/assets/images/android-chrome-512x512.png new file mode 100644 index 0000000..980e96c Binary files /dev/null and b/src/assets/images/android-chrome-512x512.png differ diff --git a/src/assets/images/apple-touch-icon.png b/src/assets/images/apple-touch-icon.png new file mode 100644 index 0000000..70400e3 Binary files /dev/null and b/src/assets/images/apple-touch-icon.png differ diff --git a/src/assets/images/mstile-150x150.png b/src/assets/images/mstile-150x150.png new file mode 100644 index 0000000..8219d99 Binary files /dev/null and b/src/assets/images/mstile-150x150.png differ diff --git a/src/index.html b/src/index.html index 1dc11c5..fa7952c 100644 --- a/src/index.html +++ b/src/index.html @@ -2,13 +2,26 @@ - QEdu Provas - + + + + + + + + + + + - - + + + QEdu Provas Loading.. + + + diff --git a/src/manifest.json b/src/manifest.json new file mode 100644 index 0000000..02b2fed --- /dev/null +++ b/src/manifest.json @@ -0,0 +1,19 @@ +{ + "name": "QEdu Provas", + "short_name": "QEdu Provas", + "start_url": "./", + "display": "standalone", + "orientation": "portrait", + "background_color": "#2c8230", + "theme_color": "#2c8230", + "icons": [{ + "src": "assets/images/android-chrome-192x192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "assets/images/android-chrome-512x512.png", + "type": "image/png", + "sizes": "512x512" + }] +} diff --git a/sw-precache.conf.js b/sw-precache.conf.js new file mode 100644 index 0000000..9616847 --- /dev/null +++ b/sw-precache.conf.js @@ -0,0 +1,24 @@ +module.exports = { + staticFileGlobs: [ + 'dist/assets/**', + 'dist/**.html', + 'dist/**.css}', + 'dist/**.js', + 'dist/**.svg', + 'dist/**.gif', + 'dist/**.png', + 'dist/**.jpg', + 'dist/**.jpeg', + 'dist/**.ico', + 'dist/**.eot', + 'dist/**.ttf', + 'dist/**.woff', + 'dist/**.woff2' + ], + root: 'dist', + stripPrefix: 'dist/', + directoryIndex: 'index.html', + navigateFallback: 'index.html', + maximumFileSizeToCacheInBytes: 3 * 1024 * 1024, + runtimeCaching: [] +}