From 7e5f6b557cd90e5f62170f54aa65e543a2e5d834 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 30 Jun 2022 18:37:18 +0200 Subject: [PATCH] fix(vite-legacy): https://github.com/vitejs/vite/pull/4767 ; do not know why but get out of my sight --- patches/@vitejs+plugin-legacy+1.8.2.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 patches/@vitejs+plugin-legacy+1.8.2.patch diff --git a/patches/@vitejs+plugin-legacy+1.8.2.patch b/patches/@vitejs+plugin-legacy+1.8.2.patch new file mode 100644 index 00000000000..231d5b1480f --- /dev/null +++ b/patches/@vitejs+plugin-legacy+1.8.2.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/@vitejs/plugin-legacy/index.js b/node_modules/@vitejs/plugin-legacy/index.js +index 2f1b199..1901ef6 100644 +--- a/node_modules/@vitejs/plugin-legacy/index.js ++++ b/node_modules/@vitejs/plugin-legacy/index.js +@@ -23,7 +23,7 @@ const detectDynamicImportVarName = '__vite_is_dynamic_import_support' + const detectDynamicImportCode = `try{import("_").catch(()=>1);}catch(e){}window.${detectDynamicImportVarName}=true;` + const dynamicFallbackInlineCode = `!function(){if(window.${detectDynamicImportVarName})return;console.warn("vite: loading legacy build because dynamic import is unsupported, syntax error above should be ignored");var e=document.getElementById("${legacyPolyfillId}"),n=document.createElement("script");n.src=e.src,n.onload=function(){${systemJSInlineCode}},document.body.appendChild(n)}();` + +-const forceDynamicImportUsage = `export function __vite_legacy_guard(){import('data:text/javascript,')};` ++const forceDynamicImportUsage = `` + + const legacyEnvVarMarker = `__VITE_IS_LEGACY__` +