Skip to content

Commit

Permalink
Wepack instruction to build service worker
Browse files Browse the repository at this point in the history
  • Loading branch information
sansmoraxz committed Dec 22, 2022
1 parent 8670701 commit f90ce7c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ const CopyPlugin = require('copy-webpack-plugin');

module.exports = {
entry: {
index: path.resolve(__dirname, 'src', 'index.js')
index: path.resolve(__dirname, 'src', 'index.js'),
service_worker: path.resolve(__dirname, 'src', 'serviceWorker', 'service_worker.js'),
},
output: {
filename: '[name].[contenthash].js',
filename: '[name].js',
path: path.resolve(__dirname, 'dist/web'),
clean: true
},
Expand Down Expand Up @@ -43,7 +44,8 @@ module.exports = {
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html'
template: './src/index.html',
chunks : ['index']
}),
new CopyPlugin({
patterns: [{
Expand Down

0 comments on commit f90ce7c

Please sign in to comment.