Created
February 27, 2019 23:00
-
-
Save webmaxru/b5ee66b02de620b5d20f30c2395abf57 to your computer and use it in GitHub Desktop.
Workbox 4: workbox-window. SW build script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {injectManifest} = require('workbox-build') | |
let workboxConfig = { | |
globDirectory: 'dist/angular-pwa', | |
globPatterns: [ | |
'favicon.ico', | |
'index.html', | |
'*.css', | |
'*.js' | |
], | |
swSrc: 'src/service-worker.js', | |
swDest: 'dist/angular-pwa/service-worker.js' | |
} | |
injectManifest(workboxConfig) | |
.then(({count, size}) => { | |
console.log(`Generated ${workboxConfig.swDest}, which will precache ${count} files, totaling ${size} bytes.`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment