diff options
| author | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2024-03-09 08:57:59 +0530 |
|---|---|---|
| committer | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2024-03-09 08:57:59 +0530 |
| commit | f4a94bed13a8595ec8a15e3ea8315aeb5aecc744 (patch) | |
| tree | e563f1a74a657348f13999c125f5ca12d200f8e6 /config/webpack/plugins/create-manifest-webpack-plugin/index.js | |
| parent | 435b16e29080f49e1ec373f5b0f552559ca04686 (diff) | |
| download | banglar-bhumi-utils-f4a94bed13a8595ec8a15e3ea8315aeb5aecc744.tar.gz banglar-bhumi-utils-f4a94bed13a8595ec8a15e3ea8315aeb5aecc744.zip | |
A lot of changes :)
Diffstat (limited to 'config/webpack/plugins/create-manifest-webpack-plugin/index.js')
| -rw-r--r-- | config/webpack/plugins/create-manifest-webpack-plugin/index.js | 14 |
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 = [ { |
