Skip to content

Instantly share code, notes, and snippets.

@jeffposnick
Created March 24, 2021 19:43
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 jeffposnick/364ed09e66cf01a84d2e60be44163ea6 to your computer and use it in GitHub Desktop.
Save jeffposnick/364ed09e66cf01a84d2e60be44163ea6 to your computer and use it in GitHub Desktop.
workbox-webpack-plugin example
{
"name": "demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^5.28.0",
"webpack-cli": "^4.5.0",
"workbox-webpack-plugin": "^6.1.2"
}
}
const {GenerateSW} = require('workbox-webpack-plugin');
const path = require('path');
module.exports = {
entry: './index.js',
mode: 'development',
output: {
filename: 'index.[contenthash].js',
path: path.join(__dirname, 'build'),
},
plugins: [
new GenerateSW(),
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment