vite 7.1.9 → 7.1.11
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/client/client.mjs +20 -7
- package/dist/node/chunks/{dep-D6Kf1CgD.js → build.js} +2 -2
- package/dist/node/chunks/{dep-DrqJEUj9.js → build2.js} +14 -25
- package/dist/node/chunks/{dep-Chhhsdoe.js → config.js} +250 -374
- package/dist/node/chunks/{dep-iA2HHN2w.js → config2.js} +2 -2
- package/dist/node/chunks/{dep-CCSnTAeo.js → dist.js} +3 -6
- package/dist/node/chunks/{dep-BuoK8Wda.js → lib.js} +1 -1
- package/dist/node/chunks/{dep-SmwnYDP9.js → logger.js} +1 -1
- package/dist/node/{moduleRunnerTransport-BWUZBVLX.d.ts → chunks/moduleRunnerTransport.d.ts} +1 -1
- package/dist/node/chunks/{dep-ifi-OWiW.js → optimizer.js} +2 -2
- package/dist/node/chunks/{dep-CwrJo3zV.js → postcss-import.js} +2 -2
- package/dist/node/chunks/preview.js +4 -0
- package/dist/node/chunks/{dep-BcOQquCi.js → server.js} +2 -2
- package/dist/node/cli.js +12 -15
- package/dist/node/index.d.ts +11 -11
- package/dist/node/index.js +2 -2
- package/dist/node/module-runner.d.ts +4 -4
- package/dist/node/module-runner.js +3 -4
- package/package.json +10 -12
- package/dist/node/chunks/dep-DAJvlA4P.js +0 -4
- /package/dist/node/chunks/{dep-lCKrEJQm.js → chunk.js} +0 -0
package/dist/client/client.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@vite/env";
|
|
2
2
|
|
|
3
|
-
//#region \0@oxc-project+runtime@0.
|
|
3
|
+
//#region \0@oxc-project+runtime@0.94.0/helpers/typeof.js
|
|
4
4
|
function _typeof(o) {
|
|
5
5
|
"@babel/helpers - typeof";
|
|
6
6
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
@@ -11,7 +11,7 @@ function _typeof(o) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
|
-
//#region \0@oxc-project+runtime@0.
|
|
14
|
+
//#region \0@oxc-project+runtime@0.94.0/helpers/toPrimitive.js
|
|
15
15
|
function toPrimitive(t, r) {
|
|
16
16
|
if ("object" != _typeof(t) || !t) return t;
|
|
17
17
|
var e = t[Symbol.toPrimitive];
|
|
@@ -24,14 +24,14 @@ function toPrimitive(t, r) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
-
//#region \0@oxc-project+runtime@0.
|
|
27
|
+
//#region \0@oxc-project+runtime@0.94.0/helpers/toPropertyKey.js
|
|
28
28
|
function toPropertyKey(t) {
|
|
29
29
|
var i = toPrimitive(t, "string");
|
|
30
30
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region \0@oxc-project+runtime@0.
|
|
34
|
+
//#region \0@oxc-project+runtime@0.94.0/helpers/defineProperty.js
|
|
35
35
|
function _defineProperty(e, r, t) {
|
|
36
36
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
37
37
|
value: t,
|
|
@@ -1047,11 +1047,18 @@ async function waitForSuccessfulPingInternal(socketUrl, visibilityManager, ms =
|
|
|
1047
1047
|
} else await waitForWindowShow(visibilityManager);
|
|
1048
1048
|
}
|
|
1049
1049
|
const sheetsMap = /* @__PURE__ */ new Map();
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1050
|
+
const linkSheetsMap = /* @__PURE__ */ new Map();
|
|
1051
|
+
if ("document" in globalThis) {
|
|
1052
|
+
document.querySelectorAll("style[data-vite-dev-id]").forEach((el) => {
|
|
1053
|
+
sheetsMap.set(el.getAttribute("data-vite-dev-id"), el);
|
|
1054
|
+
});
|
|
1055
|
+
document.querySelectorAll("link[rel=\"stylesheet\"][data-vite-dev-id]").forEach((el) => {
|
|
1056
|
+
linkSheetsMap.set(el.getAttribute("data-vite-dev-id"), el);
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1053
1059
|
let lastInsertedStyle;
|
|
1054
1060
|
function updateStyle(id, content) {
|
|
1061
|
+
if (linkSheetsMap.has(id)) return;
|
|
1055
1062
|
let style = sheetsMap.get(id);
|
|
1056
1063
|
if (!style) {
|
|
1057
1064
|
style = document.createElement("style");
|
|
@@ -1070,6 +1077,12 @@ function updateStyle(id, content) {
|
|
|
1070
1077
|
sheetsMap.set(id, style);
|
|
1071
1078
|
}
|
|
1072
1079
|
function removeStyle(id) {
|
|
1080
|
+
if (linkSheetsMap.has(id)) {
|
|
1081
|
+
document.querySelectorAll(`link[rel="stylesheet"][data-vite-dev-id]`).forEach((el) => {
|
|
1082
|
+
if (el.getAttribute("data-vite-dev-id") === id) el.remove();
|
|
1083
|
+
});
|
|
1084
|
+
linkSheetsMap.delete(id);
|
|
1085
|
+
}
|
|
1073
1086
|
const style = sheetsMap.get(id);
|
|
1074
1087
|
if (style) {
|
|
1075
1088
|
document.head.removeChild(style);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { BuildEnvironment, build, buildEnvironmentOptionsDefaults, builderOptionsDefaults, createBuilder, createToImportMetaURLBasedRelativeRuntime, injectEnvironmentToHooks, onRollupLog, resolveBuildEnvironmentOptions, resolveBuildOutputs, resolveBuildPlugins, resolveBuilderOptions, resolveLibFilename, resolveUserExternal, toOutputFilePathInCss, toOutputFilePathInHtml, toOutputFilePathInJS, toOutputFilePathWithoutRuntime } from "./
|
|
1
|
+
import "./logger.js";
|
|
2
|
+
import { BuildEnvironment, build, buildEnvironmentOptionsDefaults, builderOptionsDefaults, createBuilder, createToImportMetaURLBasedRelativeRuntime, injectEnvironmentToHooks, onRollupLog, resolveBuildEnvironmentOptions, resolveBuildOutputs, resolveBuildPlugins, resolveBuilderOptions, resolveLibFilename, resolveUserExternal, toOutputFilePathInCss, toOutputFilePathInHtml, toOutputFilePathInJS, toOutputFilePathWithoutRuntime } from "./config.js";
|
|
3
3
|
|
|
4
4
|
export { createBuilder, resolveBuildPlugins };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __commonJS, __require } from "./
|
|
2
|
-
import { require_lib } from "./
|
|
1
|
+
import { __commonJS, __require } from "./chunk.js";
|
|
2
|
+
import { require_lib } from "./lib.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.6/node_modules/postcss-modules/build/fs.js
|
|
5
5
|
var require_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.6/node_modules/postcss-modules/build/fs.js": ((exports) => {
|
|
@@ -1043,8 +1043,7 @@ var require_topologicalSort = /* @__PURE__ */ __commonJS({ "../../node_modules/.
|
|
|
1043
1043
|
const TEMPORARY_MARKER = 1;
|
|
1044
1044
|
function createError(node, graph) {
|
|
1045
1045
|
const er = /* @__PURE__ */ new Error("Nondeterministic import's order");
|
|
1046
|
-
|
|
1047
|
-
er.nodes = [node, relatedNode];
|
|
1046
|
+
er.nodes = [node, graph[node].find((relatedNode) => graph[relatedNode].indexOf(node) > -1)];
|
|
1048
1047
|
return er;
|
|
1049
1048
|
}
|
|
1050
1049
|
function walkGraph(node, graph, state, result, strict) {
|
|
@@ -1160,8 +1159,7 @@ var require_src$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postc
|
|
|
1160
1159
|
parent = parent.parent;
|
|
1161
1160
|
}
|
|
1162
1161
|
const { selector: selector$1 } = declaration.parent;
|
|
1163
|
-
|
|
1164
|
-
addImportToGraph(importPath, parentRule, graph, visited);
|
|
1162
|
+
addImportToGraph(importPath, `_${parentIndexes}${selector$1}`, graph, visited);
|
|
1165
1163
|
importDecls[importPath] = declaration;
|
|
1166
1164
|
imports[importPath] = imports[importPath] || {};
|
|
1167
1165
|
tmpSymbols = symbols.split(/\s+/).map((s) => {
|
|
@@ -1174,13 +1172,10 @@ var require_src$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postc
|
|
|
1174
1172
|
declaration.value = values.join(", ");
|
|
1175
1173
|
});
|
|
1176
1174
|
const importsOrder = topologicalSort(graph, failOnWrongOrder);
|
|
1177
|
-
if (importsOrder instanceof Error) {
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
word: "composes"
|
|
1182
|
-
});
|
|
1183
|
-
}
|
|
1175
|
+
if (importsOrder instanceof Error) throw importDecls[importsOrder.nodes.find((importPath) => importDecls.hasOwnProperty(importPath))].error("Failed to resolve order of composed modules " + importsOrder.nodes.map((importPath) => "`" + importPath + "`").join(", ") + ".", {
|
|
1176
|
+
plugin: "postcss-modules-extract-imports",
|
|
1177
|
+
word: "composes"
|
|
1178
|
+
});
|
|
1184
1179
|
let lastImportRule;
|
|
1185
1180
|
importsOrder.forEach((path$2) => {
|
|
1186
1181
|
const importedSymbols = imports[path$2];
|
|
@@ -1631,12 +1626,10 @@ var require_generic_names = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
|
|
|
1631
1626
|
*/
|
|
1632
1627
|
return function generate(localName, filepath) {
|
|
1633
1628
|
var name = pattern.replace(/\[local\]/gi, localName);
|
|
1634
|
-
|
|
1635
|
-
var loaderOptions = {
|
|
1629
|
+
return interpolateName({ resourcePath: filepath }, name, {
|
|
1636
1630
|
content: hashPrefix + path.relative(context, filepath).replace(/\\/g, "/") + "\0" + localName,
|
|
1637
1631
|
context
|
|
1638
|
-
};
|
|
1639
|
-
return interpolateName(loaderContext, name, loaderOptions).replace(new RegExp("[^a-zA-Z0-9\\-_\xA0-]", "g"), "-").replace(/^((-?[0-9])|--)/, "_$1");
|
|
1632
|
+
}).replace(new RegExp("[^a-zA-Z0-9\\-_\xA0-]", "g"), "-").replace(/^((-?[0-9])|--)/, "_$1");
|
|
1640
1633
|
};
|
|
1641
1634
|
};
|
|
1642
1635
|
}) });
|
|
@@ -2922,8 +2915,7 @@ var require_attribute = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/p
|
|
|
2922
2915
|
var _proto = Attribute$1.prototype;
|
|
2923
2916
|
_proto.getQuotedValue = function getQuotedValue(options) {
|
|
2924
2917
|
if (options === void 0) options = {};
|
|
2925
|
-
var
|
|
2926
|
-
var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark];
|
|
2918
|
+
var cssescopts = CSSESC_QUOTE_OPTIONS[this._determineQuoteMark(options)];
|
|
2927
2919
|
return (0, _cssesc["default"])(this._value, cssescopts);
|
|
2928
2920
|
};
|
|
2929
2921
|
_proto._determineQuoteMark = function _determineQuoteMark(options) {
|
|
@@ -5246,8 +5238,7 @@ var require_src$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postc
|
|
|
5246
5238
|
if (atRule.params) atRule.params = atRule.params.split("to").map((item) => {
|
|
5247
5239
|
const selector$1 = item.trim().slice(1, -1).trim();
|
|
5248
5240
|
if (!/^\s*:local\s*\((.+?)\)\s*$/.exec(selector$1)) return `(${selector$1})`;
|
|
5249
|
-
|
|
5250
|
-
return `(${traverseNode(parsedSelector).toString()})`;
|
|
5241
|
+
return `(${traverseNode(selectorParser().astSync(selector$1)).toString()})`;
|
|
5251
5242
|
}).join(" to ");
|
|
5252
5243
|
});
|
|
5253
5244
|
const exportedNames = Object.keys(exports$1);
|
|
@@ -5425,8 +5416,7 @@ var require_scoping = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/pos
|
|
|
5425
5416
|
function generateScopedNameDefault(name, filename, css) {
|
|
5426
5417
|
const i$1 = css.indexOf(`.${name}`);
|
|
5427
5418
|
const lineNumber = css.substr(0, i$1).split(/[\r\n]/).length;
|
|
5428
|
-
|
|
5429
|
-
return `_${name}_${hash$1}_${lineNumber}`;
|
|
5419
|
+
return `_${name}_${(0, _stringHash.default)(css).toString(36).substr(0, 5)}_${lineNumber}`;
|
|
5430
5420
|
}
|
|
5431
5421
|
function getScopedNameGenerator(generateScopedName, hashPrefix) {
|
|
5432
5422
|
const scopedNameGenerator = generateScopedName || generateScopedNameDefault;
|
|
@@ -5489,8 +5479,7 @@ var require_pluginFactory = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
|
|
|
5489
5479
|
const pluginList = getDefaultPluginsList(opts, inputFile);
|
|
5490
5480
|
const resultPluginIndex = result.processor.plugins.findIndex((plugin$1) => isOurPlugin(plugin$1));
|
|
5491
5481
|
if (resultPluginIndex === -1) throw new Error("Plugin missing from options.");
|
|
5492
|
-
const
|
|
5493
|
-
const loader = getLoader(opts, loaderPlugins);
|
|
5482
|
+
const loader = getLoader(opts, [...result.processor.plugins.slice(0, resultPluginIndex), ...pluginList]);
|
|
5494
5483
|
const fetcher = async (file, relativeTo, depTrace) => {
|
|
5495
5484
|
const unquoteFile = (0, _unquote.default)(file);
|
|
5496
5485
|
return loader.fetch.call(loader, unquoteFile, relativeTo, depTrace);
|