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-02-09 22:18:58 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-02-09 22:18:58 +0530
commitb1785a889f337460b29551bc7f85728aefd9df71 (patch)
tree19fbc6837ea606e9597d7975aeda010186563544 /config/webpack/plugins/create-manifest-webpack-plugin/index.js
parent3817d68c29862211afad739131d457864ef86826 (diff)
downloadbanglar-bhumi-utils-b1785a889f337460b29551bc7f85728aefd9df71.tar.gz
banglar-bhumi-utils-b1785a889f337460b29551bc7f85728aefd9df71.zip
Using a single webpack config for all scripts.
Diffstat (limited to 'config/webpack/plugins/create-manifest-webpack-plugin/index.js')
-rw-r--r--config/webpack/plugins/create-manifest-webpack-plugin/index.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/config/webpack/plugins/create-manifest-webpack-plugin/index.js b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
index fcfe689..7044be2 100644
--- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js
+++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
@@ -1,12 +1,14 @@
const { sources } = require("webpack");
const path = require("path");
+const scripts = require(path.resolve(process.env.SOURCE_DIR, "scripts.json"));
+
const { version } = require(path.resolve(process.env.ROOT_DIR, "package.json"));
const { getScriptRuntimeFromType } = require(path.resolve(process.env.CONFIG_DIR, "webpack/utils/script-runtime"));
const { getFileNameHash } = require(path.resolve(process.env.CONFIG_DIR, "webpack/utils/file-name-hash"));
class CreateManifestPlugin {
- constructor({ scripts }) {
+ constructor() {
this.scripts = {};
this.manifest = require("./manifest-template.json");
for (const scriptType in scripts) {
@@ -50,7 +52,7 @@ class CreateManifestPlugin {
}
}
- compilation.updateAsset(
+ compilation.emitAsset(
"manifest.json",
new sources.RawSource(JSON.stringify(this.manifest))
);