Skip to content

Commit

Permalink
Workbox will now only be loaded in production mode because it's garba…
Browse files Browse the repository at this point in the history
  • Loading branch information
luizzeroxis committed Mar 17, 2022
1 parent f2bd183 commit c497155
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 0 additions & 5 deletions webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const WorkboxPlugin = require('workbox-webpack-plugin');

module.exports = {
entry: './src/index.js',
Expand Down Expand Up @@ -37,10 +36,6 @@ module.exports = {
title: 'webgm'
}),
new MiniCssExtractPlugin(),
new WorkboxPlugin.GenerateSW({
clientsClaim: true,
skipWaiting: true,
}),
],
optimization: {
runtimeChunk: 'single',
Expand Down
7 changes: 7 additions & 0 deletions webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { merge, mergeWithRules } = require('webpack-merge');
const common = require('./webpack.common.js');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const WorkboxPlugin = require('workbox-webpack-plugin');

module.exports = mergeWithRules({
module: {
Expand All @@ -22,4 +23,10 @@ module.exports = mergeWithRules({
},
]
},
plugins: [
new WorkboxPlugin.GenerateSW({
clientsClaim: true,
skipWaiting: true,
}),
],
});

0 comments on commit c497155

Please sign in to comment.