@vitejs/plugin-legacy 4.0.0 → 4.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 +2 -1
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -93,6 +93,7 @@ async function loadBabel() {
|
|
|
93
93
|
}
|
|
94
94
|
return babel;
|
|
95
95
|
}
|
|
96
|
+
const { loadConfig: browserslistLoadConfig } = browserslist;
|
|
96
97
|
function toOutputFilePathInHtml(filename, type, hostId, hostType, config, toRelative) {
|
|
97
98
|
const { renderBuiltUrl } = config.experimental;
|
|
98
99
|
let relative = config.base === "" || config.base === "./";
|
|
@@ -281,7 +282,7 @@ function viteLegacyPlugin(options = {}) {
|
|
|
281
282
|
if (!genLegacy || config.build.ssr) {
|
|
282
283
|
return;
|
|
283
284
|
}
|
|
284
|
-
targets = options.targets ||
|
|
285
|
+
targets = options.targets || browserslistLoadConfig({ path: config.root }) || "last 2 versions and not dead, > 0.3%, Firefox ESR";
|
|
285
286
|
isDebug && console.log(`[@vitejs/plugin-legacy] targets:`, targets);
|
|
286
287
|
const getLegacyOutputFileName = (fileNames, defaultFileName = "[name]-legacy-[hash].js") => {
|
|
287
288
|
if (!fileNames) {
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
5
|
import { build, normalizePath } from 'vite';
|
|
6
6
|
import MagicString from 'magic-string';
|
|
7
7
|
import require$$0 from 'tty';
|
|
8
|
-
import
|
|
8
|
+
import browserslist from 'browserslist';
|
|
9
9
|
|
|
10
10
|
var picocolorsExports = {};
|
|
11
11
|
var picocolors = {
|
|
@@ -89,6 +89,7 @@ async function loadBabel() {
|
|
|
89
89
|
}
|
|
90
90
|
return babel;
|
|
91
91
|
}
|
|
92
|
+
const { loadConfig: browserslistLoadConfig } = browserslist;
|
|
92
93
|
function toOutputFilePathInHtml(filename, type, hostId, hostType, config, toRelative) {
|
|
93
94
|
const { renderBuiltUrl } = config.experimental;
|
|
94
95
|
let relative = config.base === "" || config.base === "./";
|
|
@@ -277,7 +278,7 @@ function viteLegacyPlugin(options = {}) {
|
|
|
277
278
|
if (!genLegacy || config.build.ssr) {
|
|
278
279
|
return;
|
|
279
280
|
}
|
|
280
|
-
targets = options.targets ||
|
|
281
|
+
targets = options.targets || browserslistLoadConfig({ path: config.root }) || "last 2 versions and not dead, > 0.3%, Firefox ESR";
|
|
281
282
|
isDebug && console.log(`[@vitejs/plugin-legacy] targets:`, targets);
|
|
282
283
|
const getLegacyOutputFileName = (fileNames, defaultFileName = "[name]-legacy-[hash].js") => {
|
|
283
284
|
if (!fileNames) {
|