vite 7.2.7 → 8.0.0-beta.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/LICENSE.md +33 -44
- package/dist/client/client.mjs +39 -5
- package/dist/node/chunks/build.js +1 -1
- package/dist/node/chunks/config.js +3 -35975
- package/dist/node/chunks/logger.js +7 -11
- package/dist/node/chunks/node.js +36036 -0
- package/dist/node/chunks/optimizer.js +1 -1
- package/dist/node/chunks/preview.js +1 -1
- package/dist/node/chunks/server.js +1 -1
- package/dist/node/cli.js +5 -4
- package/dist/node/index.d.ts +215 -78
- package/dist/node/index.js +2 -28
- package/dist/node/internal.d.ts +2 -0
- package/dist/node/internal.js +3 -0
- package/package.json +15 -22
- package/types/customEvent.d.ts +3 -1
- package/types/hmrPayload.d.ts +6 -0
- package/types/hot.d.ts +1 -1
- package/types/importMeta.d.ts +2 -2
- package/types/internal/esbuildOptions.d.ts +28 -0
- package/types/internal/rollupTypeCompat.d.ts +24 -0
- package/types/metadata.d.ts +6 -1
- package/dist/node/chunks/config2.js +0 -4
- package/types/package.json +0 -4
package/LICENSE.md
CHANGED
|
@@ -127,15 +127,11 @@ Repository: https://github.com/rolldown/rolldown
|
|
|
127
127
|
|
|
128
128
|
---------------------------------------
|
|
129
129
|
|
|
130
|
-
## @rollup/plugin-alias, @rollup/plugin-
|
|
130
|
+
## @rollup/plugin-alias, @rollup/plugin-dynamic-import-vars, @rollup/pluginutils
|
|
131
131
|
License: MIT
|
|
132
132
|
By: Johannes Stein
|
|
133
133
|
Repository: https://github.com/rollup/plugins
|
|
134
134
|
|
|
135
|
-
License: MIT
|
|
136
|
-
By: Rich Harris
|
|
137
|
-
Repository: https://github.com/rollup/plugins
|
|
138
|
-
|
|
139
135
|
License: MIT
|
|
140
136
|
By: LarsDenBakker
|
|
141
137
|
Repository: https://github.com/rollup/plugins
|
|
@@ -351,38 +347,6 @@ Repository: https://github.com/paulmillr/chokidar
|
|
|
351
347
|
|
|
352
348
|
---------------------------------------
|
|
353
349
|
|
|
354
|
-
## commondir, shell-quote
|
|
355
|
-
License: MIT
|
|
356
|
-
By: James Halliday
|
|
357
|
-
Repositories: http://github.com/substack/node-commondir, http://github.com/ljharb/shell-quote
|
|
358
|
-
|
|
359
|
-
> The MIT License
|
|
360
|
-
>
|
|
361
|
-
> Copyright (c) 2013 James Halliday (mail@substack.net)
|
|
362
|
-
>
|
|
363
|
-
> Permission is hereby granted, free of charge,
|
|
364
|
-
> to any person obtaining a copy of this software and
|
|
365
|
-
> associated documentation files (the "Software"), to
|
|
366
|
-
> deal in the Software without restriction, including
|
|
367
|
-
> without limitation the rights to use, copy, modify,
|
|
368
|
-
> merge, publish, distribute, sublicense, and/or sell
|
|
369
|
-
> copies of the Software, and to permit persons to whom
|
|
370
|
-
> the Software is furnished to do so,
|
|
371
|
-
> subject to the following conditions:
|
|
372
|
-
>
|
|
373
|
-
> The above copyright notice and this permission notice
|
|
374
|
-
> shall be included in all copies or substantial portions of the Software.
|
|
375
|
-
>
|
|
376
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
377
|
-
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
378
|
-
> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
379
|
-
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
|
380
|
-
> ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
381
|
-
> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
382
|
-
> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
383
|
-
|
|
384
|
-
---------------------------------------
|
|
385
|
-
|
|
386
350
|
## connect
|
|
387
351
|
License: MIT
|
|
388
352
|
By: TJ Holowaychuk, Douglas Christopher Wilson, Jonathan Ong, Tim Caswell
|
|
@@ -1023,13 +987,6 @@ Repository: https://github.com/micromatch/is-glob
|
|
|
1023
987
|
|
|
1024
988
|
---------------------------------------
|
|
1025
989
|
|
|
1026
|
-
## is-reference
|
|
1027
|
-
License: MIT
|
|
1028
|
-
By: Rich Harris
|
|
1029
|
-
Repository: https://github.com/Rich-Harris/is-reference
|
|
1030
|
-
|
|
1031
|
-
---------------------------------------
|
|
1032
|
-
|
|
1033
990
|
## isexe, which
|
|
1034
991
|
License: ISC
|
|
1035
992
|
By: Isaac Z. Schlueter
|
|
@@ -1817,6 +1774,38 @@ Repository: https://github.com/kevva/shebang-command
|
|
|
1817
1774
|
|
|
1818
1775
|
---------------------------------------
|
|
1819
1776
|
|
|
1777
|
+
## shell-quote
|
|
1778
|
+
License: MIT
|
|
1779
|
+
By: James Halliday
|
|
1780
|
+
Repository: http://github.com/ljharb/shell-quote
|
|
1781
|
+
|
|
1782
|
+
> The MIT License
|
|
1783
|
+
>
|
|
1784
|
+
> Copyright (c) 2013 James Halliday (mail@substack.net)
|
|
1785
|
+
>
|
|
1786
|
+
> Permission is hereby granted, free of charge,
|
|
1787
|
+
> to any person obtaining a copy of this software and
|
|
1788
|
+
> associated documentation files (the "Software"), to
|
|
1789
|
+
> deal in the Software without restriction, including
|
|
1790
|
+
> without limitation the rights to use, copy, modify,
|
|
1791
|
+
> merge, publish, distribute, sublicense, and/or sell
|
|
1792
|
+
> copies of the Software, and to permit persons to whom
|
|
1793
|
+
> the Software is furnished to do so,
|
|
1794
|
+
> subject to the following conditions:
|
|
1795
|
+
>
|
|
1796
|
+
> The above copyright notice and this permission notice
|
|
1797
|
+
> shall be included in all copies or substantial portions of the Software.
|
|
1798
|
+
>
|
|
1799
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
1800
|
+
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
1801
|
+
> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
1802
|
+
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
|
1803
|
+
> ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
1804
|
+
> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
1805
|
+
> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1806
|
+
|
|
1807
|
+
---------------------------------------
|
|
1808
|
+
|
|
1820
1809
|
## sirv
|
|
1821
1810
|
License: MIT
|
|
1822
1811
|
By: Luke Edwards
|
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.101.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.101.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.101.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.101.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,
|
|
@@ -740,6 +740,7 @@ const directSocketHost = __HMR_DIRECT_TARGET__;
|
|
|
740
740
|
const base = __BASE__ || "/";
|
|
741
741
|
const hmrTimeout = __HMR_TIMEOUT__;
|
|
742
742
|
const wsToken = __WS_TOKEN__;
|
|
743
|
+
const isBundleMode = __BUNDLED_DEV__;
|
|
743
744
|
const transport = normalizeModuleRunnerTransport((() => {
|
|
744
745
|
let wsTransport = createWebSocketModuleRunnerTransport({
|
|
745
746
|
createConnection: () => new WebSocket(`${socketProtocol}://${socketHost}?token=${wsToken}`, "vite-hmr"),
|
|
@@ -808,7 +809,14 @@ const pageReload = debounceReload(20);
|
|
|
808
809
|
const hmrClient = new HMRClient({
|
|
809
810
|
error: (err) => console.error("[vite]", err),
|
|
810
811
|
debug: (...msg) => console.debug("[vite]", ...msg)
|
|
811
|
-
}, transport, async function importUpdatedModule({
|
|
812
|
+
}, transport, isBundleMode ? async function importUpdatedModule({ url, acceptedPath, isWithinCircularImport }) {
|
|
813
|
+
const importPromise = import(base + url).then(() => globalThis.__rolldown_runtime__.loadExports(acceptedPath));
|
|
814
|
+
if (isWithinCircularImport) importPromise.catch(() => {
|
|
815
|
+
console.info(`[hmr] ${acceptedPath} failed to apply HMR as it's within a circular import. Reloading page to reset the execution order. To debug and break the circular import, you can run \`vite --debug hmr\` to log the circular dependency path if a file change triggered it.`);
|
|
816
|
+
pageReload();
|
|
817
|
+
});
|
|
818
|
+
return await importPromise;
|
|
819
|
+
} : async function importUpdatedModule({ acceptedPath, timestamp, explicitImportRequired, isWithinCircularImport }) {
|
|
812
820
|
const [acceptedPathWithoutQuery, query] = acceptedPath.split(`?`);
|
|
813
821
|
const importPromise = import(
|
|
814
822
|
/* @vite-ignore */
|
|
@@ -1101,6 +1109,32 @@ function injectQuery(url, queryToInject) {
|
|
|
1101
1109
|
const { search, hash } = new URL(url, "http://vite.dev");
|
|
1102
1110
|
return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ""}${hash || ""}`;
|
|
1103
1111
|
}
|
|
1112
|
+
if (isBundleMode && typeof DevRuntime !== "undefined") {
|
|
1113
|
+
var _ref;
|
|
1114
|
+
class ViteDevRuntime extends DevRuntime {
|
|
1115
|
+
createModuleHotContext(moduleId) {
|
|
1116
|
+
const ctx = createHotContext(moduleId);
|
|
1117
|
+
ctx._internal = {
|
|
1118
|
+
updateStyle,
|
|
1119
|
+
removeStyle
|
|
1120
|
+
};
|
|
1121
|
+
return ctx;
|
|
1122
|
+
}
|
|
1123
|
+
applyUpdates(_boundaries) {}
|
|
1124
|
+
}
|
|
1125
|
+
(_ref = globalThis).__rolldown_runtime__ ?? (_ref.__rolldown_runtime__ = new ViteDevRuntime({ send(message) {
|
|
1126
|
+
switch (message.type) {
|
|
1127
|
+
case "hmr:module-registered":
|
|
1128
|
+
transport.send({
|
|
1129
|
+
type: "custom",
|
|
1130
|
+
event: "vite:module-loaded",
|
|
1131
|
+
data: { modules: message.modules.slice() }
|
|
1132
|
+
});
|
|
1133
|
+
break;
|
|
1134
|
+
default: throw new Error(`Unknown message type: ${JSON.stringify(message)}`);
|
|
1135
|
+
}
|
|
1136
|
+
} }));
|
|
1137
|
+
}
|
|
1104
1138
|
|
|
1105
1139
|
//#endregion
|
|
1106
1140
|
export { ErrorOverlay, createHotContext, injectQuery, removeStyle, updateStyle };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./logger.js";
|
|
2
|
-
import { A as
|
|
2
|
+
import { A as createBuilder, B as resolveRolldownOptions, D as buildEnvironmentOptionsDefaults, E as build, F as resolveBuildEnvironmentOptions, G as toOutputFilePathWithoutRuntime, H as toOutputFilePathInCss, I as resolveBuildOutputs, L as resolveBuildPlugins, M as enhanceRollupError, N as injectEnvironmentToHooks, O as builderOptionsDefaults, P as onRollupLog, R as resolveBuilderOptions, T as ChunkMetadataMap, U as toOutputFilePathInHtml, V as resolveUserExternal, W as toOutputFilePathInJS, j as createToImportMetaURLBasedRelativeRuntime, k as clearLine, w as BuildEnvironment, z as resolveLibFilename } from "./node.js";
|
|
3
3
|
|
|
4
4
|
export { createBuilder, resolveBuildPlugins };
|