Skip to content

Instantly share code, notes, and snippets.

@charlesBochet
Last active June 26, 2017 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charlesBochet/c52cad33b63e645944ce351a76198ed6 to your computer and use it in GitHub Desktop.
Save charlesBochet/c52cad33b63e645944ce351a76198ed6 to your computer and use it in GitHub Desktop.
var SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin')
...
var webpackConfig = merge(baseWebpackConfig, {
...
plugins: [
...
// service worker caching
new SWPrecacheWebpackPlugin({
cacheId: 'my-vue-app',
filename: 'service-worker.js',
staticFileGlobs: ['dist/**/*.{js,html,css}'],
minify: true,
stripPrefix: 'dist/'
})
]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment