vite 8.1.3 → 8.1.5
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 +5 -5
- package/dist/node/chunks/build.js +211 -98
- package/dist/node/chunks/lib.js +1 -1
- package/dist/node/chunks/moduleRunnerTransport.d.ts +25 -26
- package/dist/node/chunks/node.js +556 -109
- package/dist/node/chunks/postcss-import.js +11 -11
- package/dist/node/cli.js +3 -4
- package/dist/node/index.d.ts +1284 -1285
- package/dist/node/index.js +1 -2
- package/dist/node/module-runner.d.ts +76 -77
- package/dist/node/module-runner.js +5 -6
- package/package.json +11 -11
- package/dist/node/chunks/logger.js +0 -364
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { HotPayload } from "#types/hmrPayload";
|
|
2
|
-
|
|
3
2
|
//#region src/shared/invokeMethods.d.ts
|
|
4
3
|
interface FetchFunctionOptions {
|
|
5
4
|
cached?: boolean;
|
|
@@ -8,47 +7,47 @@ interface FetchFunctionOptions {
|
|
|
8
7
|
type FetchResult = CachedFetchResult | ExternalFetchResult | ViteFetchResult;
|
|
9
8
|
interface CachedFetchResult {
|
|
10
9
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
* If the module is cached in the runner, this confirms
|
|
11
|
+
* it was not invalidated on the server side.
|
|
12
|
+
*/
|
|
14
13
|
cache: true;
|
|
15
14
|
}
|
|
16
15
|
interface ExternalFetchResult {
|
|
17
16
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
* The path to the externalized module starting with file://.
|
|
18
|
+
* By default this will be imported via a dynamic "import"
|
|
19
|
+
* instead of being transformed by Vite and loaded with the Vite runner.
|
|
20
|
+
*/
|
|
22
21
|
externalize: string;
|
|
23
22
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
* Type of the module. Used to determine if the import statement is correct.
|
|
24
|
+
* For example, if Vite needs to throw an error if a variable is not actually exported.
|
|
25
|
+
*/
|
|
27
26
|
type: "module" | "commonjs" | "builtin" | "network";
|
|
28
27
|
}
|
|
29
28
|
interface ViteFetchResult {
|
|
30
29
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
* Code that will be evaluated by the Vite runner.
|
|
31
|
+
* By default this will be wrapped in an async function.
|
|
32
|
+
*/
|
|
34
33
|
code: string;
|
|
35
34
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
* File path of the module on disk.
|
|
36
|
+
* This will be resolved as import.meta.url/filename.
|
|
37
|
+
* Will be `null` for virtual modules.
|
|
38
|
+
*/
|
|
40
39
|
file: string | null;
|
|
41
40
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
* Module ID in the server module graph.
|
|
42
|
+
*/
|
|
44
43
|
id: string;
|
|
45
44
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
* Module URL used in the import.
|
|
46
|
+
*/
|
|
48
47
|
url: string;
|
|
49
48
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
* Invalidate module on the client side.
|
|
50
|
+
*/
|
|
52
51
|
invalidate: boolean;
|
|
53
52
|
}
|
|
54
53
|
type InvokeMethods = {
|
|
@@ -69,8 +68,8 @@ type ModuleRunnerTransportHandlers = {
|
|
|
69
68
|
onDisconnection: () => void;
|
|
70
69
|
};
|
|
71
70
|
/**
|
|
72
|
-
* "send and connect" or "invoke" must be implemented
|
|
73
|
-
*/
|
|
71
|
+
* "send and connect" or "invoke" must be implemented
|
|
72
|
+
*/
|
|
74
73
|
interface ModuleRunnerTransport {
|
|
75
74
|
connect?(handlers: ModuleRunnerTransportHandlers): Promise<void> | void;
|
|
76
75
|
disconnect?(): Promise<void> | void;
|