fix(vite-legacy): https://github.com/vitejs/vite/pull/4767 ; do not know why but get out of my sight

This commit is contained in:
Martin 2022-06-30 18:37:18 +02:00 committed by mfo
parent 3c8a78dc7f
commit 9b03e6ecf4

View file

@ -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__`