aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-03-25 09:21:11 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-03-25 09:36:24 +0530
commitd6682a1ed9acd31dbfdb9e645cc8230c61a268c3 (patch)
tree63c5577b701c377896f4aa2985adf67f7aa3d679 /config
parentfeac7acb91a78b117241abdd0a5d80f778e15f06 (diff)
downloadbanglar-bhumi-utils-d6682a1ed9acd31dbfdb9e645cc8230c61a268c3.tar.gz
banglar-bhumi-utils-d6682a1ed9acd31dbfdb9e645cc8230c61a268c3.zip
Disable minification in development.
Diffstat (limited to 'config')
-rw-r--r--config/webpack.config.js3
-rw-r--r--config/webpack/plugins/create-manifest-webpack-plugin/index.js2
-rw-r--r--config/webpack/utils/get-injection-code.js2
3 files changed, 5 insertions, 2 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 8e27b8a..31d838e 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -53,6 +53,9 @@ module.exports = {
}
]
},
+ optimization: {
+ minimize: process.env.NODE_ENV === "production"
+ },
plugins: [
new InjectScriptPlugin(),
new CopyPlugin({
diff --git a/config/webpack/plugins/create-manifest-webpack-plugin/index.js b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
index 6984955..1940c6e 100644
--- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js
+++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
@@ -52,7 +52,7 @@ class CreateManifestPlugin {
compilation.emitAsset(
"manifest.json",
- new sources.RawSource(JSON.stringify(manifest))
+ new sources.RawSource(JSON.stringify(manifest, undefined, process.env.NODE_ENV === "production" ? undefined : "\t"))
);
}
);
diff --git a/config/webpack/utils/get-injection-code.js b/config/webpack/utils/get-injection-code.js
index 71afa93..51d1c20 100644
--- a/config/webpack/utils/get-injection-code.js
+++ b/config/webpack/utils/get-injection-code.js
@@ -19,5 +19,5 @@ module.exports.getInjectionCode = (code, front) => {
? "t.innerHTML=i+t.innerHTML"
: "t.innerHTML+=i";
- return `(()=>{let e=new MutationObserver(()=>{let t=document.querySelector("head > script:nth-child(54)");if(t){let i=\`(()=>{${finalCode}})();\`;${concatenationCode},e.disconnect()}});e.observe(document,{childList:!0,subtree:!0})})();`;
+ return `(()=>{let e=new MutationObserver(()=>{let t=document.querySelector("head > script:nth-child(54)");if(t){let i=\`${finalCode}\`;${concatenationCode},e.disconnect()}});e.observe(document,{childList:!0,subtree:!0})})();`;
};