From 0cbc8a421bb8a9ccb165d42e7b0e5e6980d8426a Mon Sep 17 00:00:00 2001 From: Kai Vandivier Date: Sat, 11 Mar 2023 16:02:38 +0100 Subject: [PATCH] fix(plugins): inject precache manifest correctly --- cli/config/plugin.webpack.config.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/config/plugin.webpack.config.js b/cli/config/plugin.webpack.config.js index f1eb60bc6..b22fe6a7f 100644 --- a/cli/config/plugin.webpack.config.js +++ b/cli/config/plugin.webpack.config.js @@ -187,8 +187,10 @@ module.exports = ({ env: webpackEnv, config, paths }) => { resourceRegExp: /^\.\/locale$/, contextRegExp: /moment$/, }), - // dhis2: Inject plugin static assets to the existing SW's precache manifest - process.env.NODE_ENV === 'production' && + // dhis2: Inject plugin static assets to the existing SW's precache + // manifest. Don't need to do in dev because precaching isn't done + // in dev environments + isProduction && new WorkboxWebpackPlugin.InjectManifest({ swSrc: paths.shellBuildServiceWorker, injectionPoint: 'self.__WB_PLUGIN_MANIFEST',