From 0404234c26f6813025e9eedd9981e1536db28b2a Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Thu, 9 Feb 2023 13:50:24 +0530 Subject: Combined the scripts with the same runtime into a single file to improve performance --- config/webpack/utils/script-runtime.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 config/webpack/utils/script-runtime.js (limited to 'config/webpack/utils/script-runtime.js') 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"; + } +}; -- cgit v1.2.3