Skip to content

Instantly share code, notes, and snippets.

@davehax
Created March 27, 2018 03:45
Show Gist options
  • Save davehax/8b0ec3a34b64af57604b0d7c06314cf2 to your computer and use it in GitHub Desktop.
Save davehax/8b0ec3a34b64af57604b0d7c06314cf2 to your computer and use it in GitHub Desktop.
// webpack.config.js example
var OfflinePlugin = require('offline-plugin');
module.exports = {
// ...
plugins: [
// ... other plugins
// it's always better if OfflinePlugin is the last plugin added
new OfflinePlugin({
ServiceWorker: {
// output to root level of project
output: "../service-worker.js",
// prevent conflicts with minifiers
minify: false
}
}),
]
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment