diff --git a/webpack.common.js b/webpack.common.js index 2e3d97c..412c1aa 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -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', @@ -37,10 +36,6 @@ module.exports = { title: 'webgm' }), new MiniCssExtractPlugin(), - new WorkboxPlugin.GenerateSW({ - clientsClaim: true, - skipWaiting: true, - }), ], optimization: { runtimeChunk: 'single', diff --git a/webpack.prod.js b/webpack.prod.js index e9cde22..f231c1c 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -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: { @@ -22,4 +23,10 @@ module.exports = mergeWithRules({ }, ] }, + plugins: [ + new WorkboxPlugin.GenerateSW({ + clientsClaim: true, + skipWaiting: true, + }), + ], }); \ No newline at end of file