@vitejs/plugin-legacy 6.0.1 → 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 +11 -4
- package/dist/index.mjs +11 -4
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -256,8 +256,8 @@ function viteLegacyPlugin(options = {}) {
|
|
|
256
256
|
config2.build.cssTarget = "chrome61";
|
|
257
257
|
}
|
|
258
258
|
if (genLegacy) {
|
|
259
|
-
overriddenBuildTarget = config2.build.target !==
|
|
260
|
-
overriddenDefaultModernTargets = options.modernTargets !==
|
|
259
|
+
overriddenBuildTarget = config2.build.target !== void 0;
|
|
260
|
+
overriddenDefaultModernTargets = options.modernTargets !== void 0;
|
|
261
261
|
if (options.modernTargets) {
|
|
262
262
|
const { default: browserslistToEsbuild } = await import('browserslist-to-esbuild');
|
|
263
263
|
config2.build.target = browserslistToEsbuild(options.modernTargets);
|
|
@@ -287,6 +287,13 @@ function viteLegacyPlugin(options = {}) {
|
|
|
287
287
|
)
|
|
288
288
|
);
|
|
289
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
|
+
}
|
|
290
297
|
}
|
|
291
298
|
};
|
|
292
299
|
const legacyGenerateBundlePlugin = {
|
|
@@ -488,7 +495,7 @@ function viteLegacyPlugin(options = {}) {
|
|
|
488
495
|
configFile: false,
|
|
489
496
|
compact: !!config.build.minify,
|
|
490
497
|
sourceMaps,
|
|
491
|
-
inputSourceMap:
|
|
498
|
+
inputSourceMap: void 0,
|
|
492
499
|
presets: [
|
|
493
500
|
// forcing our plugin to run before preset-env by wrapping it in a
|
|
494
501
|
// preset so we can catch the injected import statements...
|
|
@@ -675,7 +682,7 @@ function createBabelPresetEnvOptions(targets, { needPolyfills = true }) {
|
|
|
675
682
|
corejs: needPolyfills ? {
|
|
676
683
|
version: _require("core-js/package.json").version,
|
|
677
684
|
proposals: false
|
|
678
|
-
} :
|
|
685
|
+
} : void 0,
|
|
679
686
|
shippedProposals: true,
|
|
680
687
|
ignoreBrowserslistConfig: true
|
|
681
688
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -244,8 +244,8 @@ function viteLegacyPlugin(options = {}) {
|
|
|
244
244
|
config2.build.cssTarget = "chrome61";
|
|
245
245
|
}
|
|
246
246
|
if (genLegacy) {
|
|
247
|
-
overriddenBuildTarget = config2.build.target !==
|
|
248
|
-
overriddenDefaultModernTargets = options.modernTargets !==
|
|
247
|
+
overriddenBuildTarget = config2.build.target !== void 0;
|
|
248
|
+
overriddenDefaultModernTargets = options.modernTargets !== void 0;
|
|
249
249
|
if (options.modernTargets) {
|
|
250
250
|
const { default: browserslistToEsbuild } = await import('browserslist-to-esbuild');
|
|
251
251
|
config2.build.target = browserslistToEsbuild(options.modernTargets);
|
|
@@ -275,6 +275,13 @@ function viteLegacyPlugin(options = {}) {
|
|
|
275
275
|
)
|
|
276
276
|
);
|
|
277
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
|
+
}
|
|
278
285
|
}
|
|
279
286
|
};
|
|
280
287
|
const legacyGenerateBundlePlugin = {
|
|
@@ -476,7 +483,7 @@ function viteLegacyPlugin(options = {}) {
|
|
|
476
483
|
configFile: false,
|
|
477
484
|
compact: !!config.build.minify,
|
|
478
485
|
sourceMaps,
|
|
479
|
-
inputSourceMap:
|
|
486
|
+
inputSourceMap: void 0,
|
|
480
487
|
presets: [
|
|
481
488
|
// forcing our plugin to run before preset-env by wrapping it in a
|
|
482
489
|
// preset so we can catch the injected import statements...
|
|
@@ -663,7 +670,7 @@ function createBabelPresetEnvOptions(targets, { needPolyfills = true }) {
|
|
|
663
670
|
corejs: needPolyfills ? {
|
|
664
671
|
version: _require("core-js/package.json").version,
|
|
665
672
|
proposals: false
|
|
666
|
-
} :
|
|
673
|
+
} : void 0,
|
|
667
674
|
shippedProposals: true,
|
|
668
675
|
ignoreBrowserslistConfig: true
|
|
669
676
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/plugin-legacy",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -36,8 +36,8 @@
|
|
|
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.
|
|
39
|
+
"@babel/core": "^7.26.9",
|
|
40
|
+
"@babel/preset-env": "^7.26.9",
|
|
41
41
|
"browserslist": "^4.24.4",
|
|
42
42
|
"browserslist-to-esbuild": "^2.1.1",
|
|
43
43
|
"core-js": "^3.40.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"acorn": "^8.14.0",
|
|
54
54
|
"picocolors": "^1.1.1",
|
|
55
55
|
"unbuild": "^3.3.1",
|
|
56
|
-
"vite": "6.
|
|
56
|
+
"vite": "6.2.0"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"dev": "unbuild --stub",
|