aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack/plugins/create-manifest-webpack-plugin/index.js
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-04-04 14:53:04 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-04-04 14:53:04 +0530
commit5f23f07d04073c06af530332c2d75b48d6c023a0 (patch)
tree2c7359a2b33b95f92f3bba9a9074e6bf9137ac1d /config/webpack/plugins/create-manifest-webpack-plugin/index.js
parentd178caee5c93ad9ed91dbd082b0f0b5a9b0507aa (diff)
downloadbanglar-bhumi-utils-5f23f07d04073c06af530332c2d75b48d6c023a0.tar.gz
banglar-bhumi-utils-5f23f07d04073c06af530332c2d75b48d6c023a0.zip
Using different global variables for shared modules.
Diffstat (limited to 'config/webpack/plugins/create-manifest-webpack-plugin/index.js')
-rw-r--r--config/webpack/plugins/create-manifest-webpack-plugin/index.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/config/webpack/plugins/create-manifest-webpack-plugin/index.js b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
index 785d604..a2040da 100644
--- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js
+++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
@@ -2,7 +2,7 @@ const { sources } = require("webpack");
const path = require("path");
const { getScriptRuntimeFromType } = webpackRequire("utils/script-runtime");
-const { getFileNameHash } = webpackRequire("utils/file-name-hash");
+const { getFileNameHash } = webpackRequire("utils/filename-hash");
const scripts = webpackRequire("utils/scripts");
const sharedModules = webpackRequire("utils/shared-modules");
const manifest = webpackRequire("plugins/create-manifest-webpack-plugin/manifest-template.json");
@@ -35,6 +35,14 @@ class CreateManifestPlugin {
}
}
+ for (const sharedModule of sharedModules) {
+ manifest.content_scripts.push({
+ matches: [`*://banglarbhumi.gov.in/BanglarBhumi/*`],
+ js: [`shared/${getFileNameHash(sharedModule, "shared")}.js`],
+ run_at: "document_start"
+ });
+ }
+
const resources = [];
for (const assetName in assets) {
@@ -43,10 +51,6 @@ class CreateManifestPlugin {
}
}
- for (const sharedModule of sharedModules) {
- resources.push(`shared/${getFileNameHash(sharedModule, "shared")}.js`);
- }
-
if (resources.length > 0) {
manifest.web_accessible_resources = [
{