diff options
| author | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2023-02-08 18:51:39 +0530 |
|---|---|---|
| committer | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2023-02-08 18:51:39 +0530 |
| commit | 915947e3e7ab7c1fa07596ab4b13bf6e1cc50b76 (patch) | |
| tree | 8e8a7137d2177dc52da83a5af9e8f7b442ed4a71 /config/webpack/plugins/create-manifest-webpack-plugin | |
| parent | 4993aaf41e132dd0805bf6c487901d9f2aecfcfe (diff) | |
| download | banglar-bhumi-utils-915947e3e7ab7c1fa07596ab4b13bf6e1cc50b76.tar.gz banglar-bhumi-utils-915947e3e7ab7c1fa07596ab4b13bf6e1cc50b76.zip | |
Cleaned code.
Diffstat (limited to 'config/webpack/plugins/create-manifest-webpack-plugin')
| -rw-r--r-- | config/webpack/plugins/create-manifest-webpack-plugin/index.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/config/webpack/plugins/create-manifest-webpack-plugin/index.js b/config/webpack/plugins/create-manifest-webpack-plugin/index.js index 4a07380..6bbb485 100644 --- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js +++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js @@ -1,3 +1,4 @@ +const { sources } = require("webpack"); const path = require("path"); const { version } = require(path.resolve(process.env.ROOT_DIR, "package.json")); @@ -34,10 +35,10 @@ class CreateManifestPlugin { compilation.hooks.processAssets.tap( { name: "CreateManifestPlugin", - stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE, + stage: compiler.webpack.Compilation.PROCESS_ASSETS_ADDITIONAL, additionalAssets: true }, - assets => { + () => { this.manifest.version = version; this.manifest.content_scripts = [] @@ -64,8 +65,10 @@ class CreateManifestPlugin { } } - const { RawSource } = compiler.webpack.sources; - assets["manifest.json"] = new RawSource(Buffer.from(JSON.stringify(this.manifest))); + compilation.updateAsset( + "manifest.json", + new sources.RawSource(JSON.stringify(this.manifest)) + ); } ); }); |
