aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack/plugins/create-manifest-webpack-plugin/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'config/webpack/plugins/create-manifest-webpack-plugin/index.js')
-rw-r--r--config/webpack/plugins/create-manifest-webpack-plugin/index.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/config/webpack/plugins/create-manifest-webpack-plugin/index.js b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
index f2e28b2..e28c695 100644
--- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js
+++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
@@ -104,6 +104,12 @@ class CreateManifestPlugin {
}
}
+ // `CreateRulesPlugin` skips emitting `rules.json` when `src/rules/`
+ // holds no rule files, so drop the ruleset reference with it.
+ if (!("rules.json" in assets)) {
+ delete manifest.declarative_net_request;
+ }
+
const injectedSharedModules = this.sortedSharedModules
.filter((sharedModule) => this.injectedSharedModulesImportedCount[sharedModule] > 0)
.map((sharedModule) => `shared/${getFileName(sharedModule, "shared")}.js`);