@vitejs/plugin-legacy 6.0.0 → 6.0.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/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
- if (!babel) {
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) {
@@ -290,6 +287,13 @@ function viteLegacyPlugin(options = {}) {
290
287
  )
291
288
  );
292
289
  }
290
+ if (config2.isWorker) {
291
+ config2.logger.warn(
292
+ colors.yellow(
293
+ `plugin-legacy should not be passed to 'worker.plugins'. Pass to 'plugins' instead. Note that generating legacy chunks for workers are not supported by plugin-legacy.`
294
+ )
295
+ );
296
+ }
293
297
  }
294
298
  };
295
299
  const legacyGenerateBundlePlugin = {
@@ -707,6 +711,7 @@ async function buildPolyfillChunk(mode, imports, bundle, facadeToChunkMap, build
707
711
  },
708
712
  output: {
709
713
  format,
714
+ hashCharacters: rollupOutputOptions.hashCharacters,
710
715
  entryFileNames: rollupOutputOptions.entryFileNames
711
716
  }
712
717
  }
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
- if (!babel) {
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) {
@@ -278,6 +275,13 @@ function viteLegacyPlugin(options = {}) {
278
275
  )
279
276
  );
280
277
  }
278
+ if (config2.isWorker) {
279
+ config2.logger.warn(
280
+ colors.yellow(
281
+ `plugin-legacy should not be passed to 'worker.plugins'. Pass to 'plugins' instead. Note that generating legacy chunks for workers are not supported by plugin-legacy.`
282
+ )
283
+ );
284
+ }
281
285
  }
282
286
  };
283
287
  const legacyGenerateBundlePlugin = {
@@ -695,6 +699,7 @@ async function buildPolyfillChunk(mode, imports, bundle, facadeToChunkMap, build
695
699
  },
696
700
  output: {
697
701
  format,
702
+ hashCharacters: rollupOutputOptions.hashCharacters,
698
703
  entryFileNames: rollupOutputOptions.entryFileNames
699
704
  }
700
705
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitejs/plugin-legacy",
3
- "version": "6.0.0",
3
+ "version": "6.0.2",
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.0",
40
- "@babel/preset-env": "^7.26.0",
41
- "browserslist": "^4.24.2",
39
+ "@babel/core": "^7.26.9",
40
+ "@babel/preset-env": "^7.26.9",
41
+ "browserslist": "^4.24.4",
42
42
  "browserslist-to-esbuild": "^2.1.1",
43
- "core-js": "^3.39.0",
44
- "magic-string": "^0.30.13",
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.0.0-rc.11",
56
- "vite": "6.0.0"
55
+ "unbuild": "^3.3.1",
56
+ "vite": "6.2.0"
57
57
  },
58
58
  "scripts": {
59
59
  "dev": "unbuild --stub",