From b200c1345392c055bfe48e1c06d6dfc2a0768565 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Tue, 29 Sep 2026 17:48:06 +0530 Subject: ci(config): ignore rules directory if src/rules is empty --- config/webpack/plugins/create-manifest-webpack-plugin/index.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'config/webpack/plugins/create-manifest-webpack-plugin/index.js') 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`); -- cgit v1.2.3