Revert "Disable workbox when running in webpack dev server, not in dev mode"
This reverts commit 11e676ce
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
daa755017e
commit
87c42934ea
2 changed files with 5 additions and 16 deletions
|
@ -1,5 +1,4 @@
|
|||
const path = require('path');
|
||||
const {EnvironmentPlugin} = require('webpack');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
|
@ -33,8 +32,6 @@ module.exports = (env, argv) => {
|
|||
const jsSdkSrcDir = path.resolve(require.resolve("matrix-js-sdk/package.json"), '..', 'src');
|
||||
|
||||
const plugins = [
|
||||
new EnvironmentPlugin(["WEBPACK_DEV_SERVER"]), // pass this as it is used for conditionally loading workbox
|
||||
|
||||
// This exports our CSS using the splitChunks and loaders above.
|
||||
new MiniCssExtractPlugin({
|
||||
filename: 'bundles/[hash]/[name].css',
|
||||
|
@ -95,8 +92,7 @@ module.exports = (env, argv) => {
|
|||
}),
|
||||
];
|
||||
|
||||
const isDevServer = process.env.WEBPACK_DEV_SERVER;
|
||||
if (!isDevServer) {
|
||||
if (argv.mode === "production") {
|
||||
plugins.push(new WorkboxPlugin.GenerateSW({
|
||||
maximumFileSizeToCacheInBytes: 22000000,
|
||||
runtimeCaching: [{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue