aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack/utils/script-runtime.js
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-02-09 13:50:24 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-02-09 13:50:24 +0530
commit0404234c26f6813025e9eedd9981e1536db28b2a (patch)
tree204e2ca55540e594e4d88eba87191b90794ddaf8 /config/webpack/utils/script-runtime.js
parent915947e3e7ab7c1fa07596ab4b13bf6e1cc50b76 (diff)
downloadbanglar-bhumi-utils-0404234c26f6813025e9eedd9981e1536db28b2a.tar.gz
banglar-bhumi-utils-0404234c26f6813025e9eedd9981e1536db28b2a.zip
Combined the scripts with the same runtime into a single file to improve performance
Diffstat (limited to 'config/webpack/utils/script-runtime.js')
-rw-r--r--config/webpack/utils/script-runtime.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/config/webpack/utils/script-runtime.js b/config/webpack/utils/script-runtime.js
new file mode 100644
index 0000000..394e87e
--- /dev/null
+++ b/config/webpack/utils/script-runtime.js
@@ -0,0 +1,15 @@
+module.exports.getScriptRuntimeFromType = scriptType => {
+ switch (scriptType) {
+ case "before":
+ case "injected":
+ case "injected_and_loaded":
+ return "document_start";
+
+ case "rendered":
+ return "document_end";
+
+ case "loaded":
+ default:
+ return "document_idle";
+ }
+};