diff options
Diffstat (limited to 'config/webpack/plugins/create-manifest-webpack-plugin')
| -rw-r--r-- | config/webpack/plugins/create-manifest-webpack-plugin/index.js | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/config/webpack/plugins/create-manifest-webpack-plugin/index.js b/config/webpack/plugins/create-manifest-webpack-plugin/index.js index 7328d5d..f5a4963 100644 --- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js +++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js @@ -1,14 +1,16 @@ -import webpack from "webpack"; -import path from "path"; import fs from "fs"; +import path from "path"; + +import webpack from "webpack"; -import { getScriptRuntimeFromType } from "../../utils/script-runtime.js"; import { getFileName } from "../../utils/build-file.js"; +import { getScriptRuntimeFromType } from "../../utils/script-runtime.js"; import scripts from "../../utils/scripts.js"; + const manifest = JSON.parse( fs.readFileSync( - path.resolve("config/webpack/plugins/create-manifest-webpack-plugin/manifest-template.json"), - ), + path.resolve("config/webpack/plugins/create-manifest-webpack-plugin/manifest-template.json") + ) ); /** @@ -44,7 +46,7 @@ class CreateManifestPlugin { name: "CreateManifestPlugin", stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL }, - assets => { + (assets) => { manifest.version = JSON.parse(fs.readFileSync((path.resolve(ROOT_DIR, "package.json")))).version; manifest.content_scripts = []; let resources = []; @@ -69,12 +71,12 @@ class CreateManifestPlugin { } manifest.content_scripts.push({ - matches: [`*://banglarbhumi.gov.in/BanglarBhumi/*`], + matches: ["*://banglarbhumi.gov.in/BanglarBhumi/*"], js: this.sortedSharedModules - .filter(sharedModule => this.sharedModulesImportedCount[sharedModule] > 0) - .map(sharedModule => `shared/${getFileName(sharedModule, "shared")}.js`) + .filter((sharedModule) => this.sharedModulesImportedCount[sharedModule] > 0) + .map((sharedModule) => `shared/${getFileName(sharedModule, "shared")}.js`) .concat(arrangedScripts["*"]["document_start"]) - .filter(x => x != null), + .filter((x) => x != null), run_at: "document_start" }); @@ -102,8 +104,8 @@ class CreateManifestPlugin { } const injectedSharedModules = this.sortedSharedModules - .filter(sharedModule => this.injectedSharedModulesImportedCount[sharedModule] > 0) - .map(sharedModule => `shared/${getFileName(sharedModule, "shared")}.js`); + .filter((sharedModule) => this.injectedSharedModulesImportedCount[sharedModule] > 0) + .map((sharedModule) => `shared/${getFileName(sharedModule, "shared")}.js`); if (injectedSharedModules.length > 0) { resources = resources.concat(injectedSharedModules); |
