@vitejs/plugin-legacy 6.0.0 → 6.0.1
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/dist/index.cjs +6 -8
- package/dist/index.mjs +6 -8
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -122,10 +122,7 @@ const modernChunkLegacyGuard = `export function __vite_legacy_guard(){${detectMo
|
|
|
122
122
|
|
|
123
123
|
let babel;
|
|
124
124
|
async function loadBabel() {
|
|
125
|
-
|
|
126
|
-
babel = await import('@babel/core');
|
|
127
|
-
}
|
|
128
|
-
return babel;
|
|
125
|
+
return babel ??= import('@babel/core');
|
|
129
126
|
}
|
|
130
127
|
const { loadConfig: browserslistLoadConfig } = browserslist__default;
|
|
131
128
|
function toOutputFilePathInHtml(filename, type, hostId, hostType, config, toRelative) {
|
|
@@ -259,8 +256,8 @@ function viteLegacyPlugin(options = {}) {
|
|
|
259
256
|
config2.build.cssTarget = "chrome61";
|
|
260
257
|
}
|
|
261
258
|
if (genLegacy) {
|
|
262
|
-
overriddenBuildTarget = config2.build.target !==
|
|
263
|
-
overriddenDefaultModernTargets = options.modernTargets !==
|
|
259
|
+
overriddenBuildTarget = config2.build.target !== undefined;
|
|
260
|
+
overriddenDefaultModernTargets = options.modernTargets !== undefined;
|
|
264
261
|
if (options.modernTargets) {
|
|
265
262
|
const { default: browserslistToEsbuild } = await import('browserslist-to-esbuild');
|
|
266
263
|
config2.build.target = browserslistToEsbuild(options.modernTargets);
|
|
@@ -491,7 +488,7 @@ function viteLegacyPlugin(options = {}) {
|
|
|
491
488
|
configFile: false,
|
|
492
489
|
compact: !!config.build.minify,
|
|
493
490
|
sourceMaps,
|
|
494
|
-
inputSourceMap:
|
|
491
|
+
inputSourceMap: undefined,
|
|
495
492
|
presets: [
|
|
496
493
|
// forcing our plugin to run before preset-env by wrapping it in a
|
|
497
494
|
// preset so we can catch the injected import statements...
|
|
@@ -678,7 +675,7 @@ function createBabelPresetEnvOptions(targets, { needPolyfills = true }) {
|
|
|
678
675
|
corejs: needPolyfills ? {
|
|
679
676
|
version: _require("core-js/package.json").version,
|
|
680
677
|
proposals: false
|
|
681
|
-
} :
|
|
678
|
+
} : undefined,
|
|
682
679
|
shippedProposals: true,
|
|
683
680
|
ignoreBrowserslistConfig: true
|
|
684
681
|
};
|
|
@@ -707,6 +704,7 @@ async function buildPolyfillChunk(mode, imports, bundle, facadeToChunkMap, build
|
|
|
707
704
|
},
|
|
708
705
|
output: {
|
|
709
706
|
format,
|
|
707
|
+
hashCharacters: rollupOutputOptions.hashCharacters,
|
|
710
708
|
entryFileNames: rollupOutputOptions.entryFileNames
|
|
711
709
|
}
|
|
712
710
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -110,10 +110,7 @@ const modernChunkLegacyGuard = `export function __vite_legacy_guard(){${detectMo
|
|
|
110
110
|
|
|
111
111
|
let babel;
|
|
112
112
|
async function loadBabel() {
|
|
113
|
-
|
|
114
|
-
babel = await import('@babel/core');
|
|
115
|
-
}
|
|
116
|
-
return babel;
|
|
113
|
+
return babel ??= import('@babel/core');
|
|
117
114
|
}
|
|
118
115
|
const { loadConfig: browserslistLoadConfig } = browserslist;
|
|
119
116
|
function toOutputFilePathInHtml(filename, type, hostId, hostType, config, toRelative) {
|
|
@@ -247,8 +244,8 @@ function viteLegacyPlugin(options = {}) {
|
|
|
247
244
|
config2.build.cssTarget = "chrome61";
|
|
248
245
|
}
|
|
249
246
|
if (genLegacy) {
|
|
250
|
-
overriddenBuildTarget = config2.build.target !==
|
|
251
|
-
overriddenDefaultModernTargets = options.modernTargets !==
|
|
247
|
+
overriddenBuildTarget = config2.build.target !== undefined;
|
|
248
|
+
overriddenDefaultModernTargets = options.modernTargets !== undefined;
|
|
252
249
|
if (options.modernTargets) {
|
|
253
250
|
const { default: browserslistToEsbuild } = await import('browserslist-to-esbuild');
|
|
254
251
|
config2.build.target = browserslistToEsbuild(options.modernTargets);
|
|
@@ -479,7 +476,7 @@ function viteLegacyPlugin(options = {}) {
|
|
|
479
476
|
configFile: false,
|
|
480
477
|
compact: !!config.build.minify,
|
|
481
478
|
sourceMaps,
|
|
482
|
-
inputSourceMap:
|
|
479
|
+
inputSourceMap: undefined,
|
|
483
480
|
presets: [
|
|
484
481
|
// forcing our plugin to run before preset-env by wrapping it in a
|
|
485
482
|
// preset so we can catch the injected import statements...
|
|
@@ -666,7 +663,7 @@ function createBabelPresetEnvOptions(targets, { needPolyfills = true }) {
|
|
|
666
663
|
corejs: needPolyfills ? {
|
|
667
664
|
version: _require("core-js/package.json").version,
|
|
668
665
|
proposals: false
|
|
669
|
-
} :
|
|
666
|
+
} : undefined,
|
|
670
667
|
shippedProposals: true,
|
|
671
668
|
ignoreBrowserslistConfig: true
|
|
672
669
|
};
|
|
@@ -695,6 +692,7 @@ async function buildPolyfillChunk(mode, imports, bundle, facadeToChunkMap, build
|
|
|
695
692
|
},
|
|
696
693
|
output: {
|
|
697
694
|
format,
|
|
695
|
+
hashCharacters: rollupOutputOptions.hashCharacters,
|
|
698
696
|
entryFileNames: rollupOutputOptions.entryFileNames
|
|
699
697
|
}
|
|
700
698
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/plugin-legacy",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-legacy#readme",
|
|
37
37
|
"funding": "https://github.com/vitejs/vite?sponsor=1",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@babel/core": "^7.26.
|
|
40
|
-
"@babel/preset-env": "^7.26.
|
|
41
|
-
"browserslist": "^4.24.
|
|
39
|
+
"@babel/core": "^7.26.7",
|
|
40
|
+
"@babel/preset-env": "^7.26.7",
|
|
41
|
+
"browserslist": "^4.24.4",
|
|
42
42
|
"browserslist-to-esbuild": "^2.1.1",
|
|
43
|
-
"core-js": "^3.
|
|
44
|
-
"magic-string": "^0.30.
|
|
43
|
+
"core-js": "^3.40.0",
|
|
44
|
+
"magic-string": "^0.30.17",
|
|
45
45
|
"regenerator-runtime": "^0.14.1",
|
|
46
46
|
"systemjs": "^6.15.1"
|
|
47
47
|
},
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"acorn": "^8.14.0",
|
|
54
54
|
"picocolors": "^1.1.1",
|
|
55
|
-
"unbuild": "^3.
|
|
56
|
-
"vite": "6.
|
|
55
|
+
"unbuild": "^3.3.1",
|
|
56
|
+
"vite": "6.1.0"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"dev": "unbuild --stub",
|