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.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 91ddf3e..da62bea 100644
--- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js
+++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
@@ -23,6 +23,7 @@ class CreateManifestPlugin {
assets => {
manifest.version = require(path.resolve(ROOT_DIR, "package.json")).version;
manifest.content_scripts = [];
+ let resources = [];
const arrangedScripts = {};
@@ -33,12 +34,15 @@ class CreateManifestPlugin {
const scriptRuntime = getScriptRuntimeFromType(scriptType);
if (typeof arrangedScripts[scriptPath][scriptRuntime] === "undefined") {
- arrangedScripts[scriptPath][scriptRuntime] = [];
- }
+ arrangedScripts[scriptPath][scriptRuntime] = [];
+ }
- arrangedScripts[scriptPath][scriptRuntime].push(`scripts/${getFileNameHash(scriptType, scriptPath)}.js`);
+ arrangedScripts[scriptPath][scriptRuntime].push(`scripts/${getFileNameHash(scriptType, scriptPath)}.js`);
+ if (scriptType.startsWith("injected")) {
+ resources.push(`scripts/injected/${getFileNameHash(scriptType, scriptPath)}.js`);
}
}
+ }
manifest.content_scripts.push({
matches: [`*://banglarbhumi.gov.in/BanglarBhumi/*`],
@@ -66,8 +70,6 @@ class CreateManifestPlugin {
}
}
- let resources = [];
-
for (const assetName in assets) {
if (/^assets\/.*\.(jpg|png|gif)$/.test(assetName)) {
resources.push(assetName);
@@ -83,6 +85,8 @@ class CreateManifestPlugin {
manifest.content_scripts[0].js.unshift(`shared/${getFileNameHash("injected-shared-modules", "shared")}.js`);
}
+ manifest.content_scripts[0].js.unshift(`shared/${getFileNameHash("script-injector", "shared")}.js`);
+
if (resources.length > 0) {
manifest.web_accessible_resources = [
{