Created
March 24, 2021 19:43
-
-
Save jeffposnick/364ed09e66cf01a84d2e60be44163ea6 to your computer and use it in GitHub Desktop.
workbox-webpack-plugin example
This file contains hidden or 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
{ | |
"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" | |
} | |
} |
This file contains hidden or 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 {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