@vitejs/plugin-legacy 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/index.js +0 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -163,7 +163,6 @@ The legacy plugin requires inline scripts for [Safari 10.1 `nomodule` fix](https
|
|
|
163
163
|
|
|
164
164
|
- `sha256-MS6/3FCg4WjP9gwgaBGwLpRCY6fZBgwmhVCdrPrNf3E=`
|
|
165
165
|
- `sha256-tQjf8gvb2ROOMapIxFvFAYBeUJ0v1HCbOcSmDNXGtDo=`
|
|
166
|
-
- `sha256-xYj09txJ9OsgySe5ommpqul6FiaJZRrwe3KTD7wbV6w=`
|
|
167
166
|
- `sha256-4m6wOIrq/wFDmi9Xh3mFM2mwI4ik9n3TMgHk6xDtLxk=`
|
|
168
167
|
- `sha256-uS7/g9fhQwNZS1f/MqYqqKv8y9hCu36IfX9XZB5L7YY=`
|
|
169
168
|
|
package/index.js
CHANGED
|
@@ -20,7 +20,6 @@ const legacyEntryId = 'vite-legacy-entry'
|
|
|
20
20
|
const systemJSInlineCode = `System.import(document.getElementById('${legacyEntryId}').getAttribute('data-src'))`
|
|
21
21
|
|
|
22
22
|
const detectDynamicImportVarName = '__vite_is_dynamic_import_support'
|
|
23
|
-
const detectDynamicImportVarInitCode = `var ${detectDynamicImportVarName}=false;`
|
|
24
23
|
const detectDynamicImportCode = `try{import("_").catch(()=>1);}catch(e){}window.${detectDynamicImportVarName}=true;`
|
|
25
24
|
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)}();`
|
|
26
25
|
|
|
@@ -437,12 +436,6 @@ function viteLegacyPlugin(options = {}) {
|
|
|
437
436
|
|
|
438
437
|
// 5. inject dynamic import fallback entry
|
|
439
438
|
if (genDynamicFallback && legacyPolyfillFilename && legacyEntryFilename) {
|
|
440
|
-
tags.push({
|
|
441
|
-
tag: 'script',
|
|
442
|
-
attrs: { type: 'module' },
|
|
443
|
-
children: detectDynamicImportVarInitCode,
|
|
444
|
-
injectTo: 'head'
|
|
445
|
-
})
|
|
446
439
|
tags.push({
|
|
447
440
|
tag: 'script',
|
|
448
441
|
attrs: { type: 'module' },
|
|
@@ -714,7 +707,6 @@ viteLegacyPlugin.default = viteLegacyPlugin
|
|
|
714
707
|
viteLegacyPlugin.cspHashes = [
|
|
715
708
|
createHash('sha256').update(safari10NoModuleFix).digest('base64'),
|
|
716
709
|
createHash('sha256').update(systemJSInlineCode).digest('base64'),
|
|
717
|
-
createHash('sha256').update(detectDynamicImportVarInitCode).digest('base64'),
|
|
718
710
|
createHash('sha256').update(detectDynamicImportCode).digest('base64'),
|
|
719
711
|
createHash('sha256').update(dynamicFallbackInlineCode).digest('base64')
|
|
720
712
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/plugin-legacy",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Evan You",
|
|
6
6
|
"files": [
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-legacy#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@babel/standalone": "^7.17.
|
|
26
|
-
"core-js": "^3.
|
|
25
|
+
"@babel/standalone": "^7.17.11",
|
|
26
|
+
"core-js": "^3.22.3",
|
|
27
27
|
"magic-string": "^0.26.1",
|
|
28
28
|
"regenerator-runtime": "^0.13.9",
|
|
29
29
|
"systemjs": "^6.12.1"
|