Skip to content

Instantly share code, notes, and snippets.

@webmaxru
Created February 27, 2019 23:00
Show Gist options
  • Save webmaxru/b5ee66b02de620b5d20f30c2395abf57 to your computer and use it in GitHub Desktop.
Save webmaxru/b5ee66b02de620b5d20f30c2395abf57 to your computer and use it in GitHub Desktop.
Workbox 4: workbox-window. SW build script
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