Skip to content

Commit

Permalink
fix(vite-legacy): vitejs/vite#4767 ; do not know why but get out of m…
Browse files Browse the repository at this point in the history
…y sight
  • Loading branch information
Martin committed Jun 30, 2022
1 parent fc8332a commit 0cd1ebc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions patches/@vitejs+plugin-legacy+1.8.2.patch
Original file line number Diff line number Diff line change
@@ -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__`

0 comments on commit 0cd1ebc

Please sign in to comment.