vite-node 0.26.1 → 0.26.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/cli.cjs +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/client.cjs +34 -32
- package/dist/client.d.ts +1 -1
- package/dist/client.mjs +34 -32
- package/dist/hmr.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/source-map.d.ts +1 -1
- package/dist/{types-57a192bf.d.ts → types-6a15e0b9.d.ts} +12 -0
- package/dist/types.d.ts +1 -1
- package/dist/utils.cjs +6 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.mjs +6 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -634,7 +634,7 @@ class CAC extends events.EventEmitter {
|
|
|
634
634
|
|
|
635
635
|
const cac = (name = "") => new CAC(name);
|
|
636
636
|
|
|
637
|
-
var version = "0.26.
|
|
637
|
+
var version = "0.26.2";
|
|
638
638
|
|
|
639
639
|
const cli = cac("vite-node");
|
|
640
640
|
cli.version(version).option("-r, --root <path>", "Use specified root directory").option("-c, --config <path>", "Use specified config file").option("-w, --watch", 'Restart on file changes, similar to "nodemon"').option("--options <options>", "Use specified Vite server options").help();
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -632,7 +632,7 @@ class CAC extends EventEmitter {
|
|
|
632
632
|
|
|
633
633
|
const cac = (name = "") => new CAC(name);
|
|
634
634
|
|
|
635
|
-
var version = "0.26.
|
|
635
|
+
var version = "0.26.2";
|
|
636
636
|
|
|
637
637
|
const cli = cac("vite-node");
|
|
638
638
|
cli.version(version).option("-r, --root <path>", "Use specified root directory").option("-c, --config <path>", "Use specified config file").option("-w, --watch", 'Restart on file changes, similar to "nodemon"').option("--options <options>", "Use specified Vite server options").help();
|
package/dist/client.cjs
CHANGED
|
@@ -39,40 +39,42 @@ var createDebug__default = /*#__PURE__*/_interopDefaultLegacy(createDebug);
|
|
|
39
39
|
|
|
40
40
|
const debugExecute = createDebug__default["default"]("vite-node:client:execute");
|
|
41
41
|
const debugNative = createDebug__default["default"]("vite-node:client:native");
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
head == null ? void 0 : head.appendChild(style);
|
|
73
|
-
}
|
|
42
|
+
const clientStub = {
|
|
43
|
+
injectQuery: (id) => id,
|
|
44
|
+
createHotContext() {
|
|
45
|
+
return {
|
|
46
|
+
accept: () => {
|
|
47
|
+
},
|
|
48
|
+
prune: () => {
|
|
49
|
+
},
|
|
50
|
+
dispose: () => {
|
|
51
|
+
},
|
|
52
|
+
decline: () => {
|
|
53
|
+
},
|
|
54
|
+
invalidate: () => {
|
|
55
|
+
},
|
|
56
|
+
on: () => {
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
updateStyle(id, css) {
|
|
61
|
+
if (typeof document === "undefined")
|
|
62
|
+
return;
|
|
63
|
+
const element = document.getElementById(id);
|
|
64
|
+
if (element)
|
|
65
|
+
element.remove();
|
|
66
|
+
const head = document.querySelector("head");
|
|
67
|
+
const style = document.createElement("style");
|
|
68
|
+
style.setAttribute("type", "text/css");
|
|
69
|
+
style.id = id;
|
|
70
|
+
style.innerHTML = css;
|
|
71
|
+
head == null ? void 0 : head.appendChild(style);
|
|
74
72
|
}
|
|
75
73
|
};
|
|
74
|
+
const DEFAULT_REQUEST_STUBS = {
|
|
75
|
+
"/@vite/client": clientStub,
|
|
76
|
+
"@vite/client": clientStub
|
|
77
|
+
};
|
|
76
78
|
class ModuleCacheMap extends Map {
|
|
77
79
|
normalizePath(fsPath) {
|
|
78
80
|
return utils.normalizeModuleId(fsPath);
|
package/dist/client.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { j as DEFAULT_REQUEST_STUBS, M as ModuleCacheMap, h as ViteNodeRunner } from './types-
|
|
1
|
+
export { j as DEFAULT_REQUEST_STUBS, M as ModuleCacheMap, h as ViteNodeRunner } from './types-6a15e0b9.js';
|
package/dist/client.mjs
CHANGED
|
@@ -12,40 +12,42 @@ import 'source-map-support';
|
|
|
12
12
|
|
|
13
13
|
const debugExecute = createDebug("vite-node:client:execute");
|
|
14
14
|
const debugNative = createDebug("vite-node:client:native");
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
head == null ? void 0 : head.appendChild(style);
|
|
46
|
-
}
|
|
15
|
+
const clientStub = {
|
|
16
|
+
injectQuery: (id) => id,
|
|
17
|
+
createHotContext() {
|
|
18
|
+
return {
|
|
19
|
+
accept: () => {
|
|
20
|
+
},
|
|
21
|
+
prune: () => {
|
|
22
|
+
},
|
|
23
|
+
dispose: () => {
|
|
24
|
+
},
|
|
25
|
+
decline: () => {
|
|
26
|
+
},
|
|
27
|
+
invalidate: () => {
|
|
28
|
+
},
|
|
29
|
+
on: () => {
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
updateStyle(id, css) {
|
|
34
|
+
if (typeof document === "undefined")
|
|
35
|
+
return;
|
|
36
|
+
const element = document.getElementById(id);
|
|
37
|
+
if (element)
|
|
38
|
+
element.remove();
|
|
39
|
+
const head = document.querySelector("head");
|
|
40
|
+
const style = document.createElement("style");
|
|
41
|
+
style.setAttribute("type", "text/css");
|
|
42
|
+
style.id = id;
|
|
43
|
+
style.innerHTML = css;
|
|
44
|
+
head == null ? void 0 : head.appendChild(style);
|
|
47
45
|
}
|
|
48
46
|
};
|
|
47
|
+
const DEFAULT_REQUEST_STUBS = {
|
|
48
|
+
"/@vite/client": clientStub,
|
|
49
|
+
"@vite/client": clientStub
|
|
50
|
+
};
|
|
49
51
|
class ModuleCacheMap extends Map {
|
|
50
52
|
normalizePath(fsPath) {
|
|
51
53
|
return normalizeModuleId(fsPath);
|
package/dist/hmr.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
2
|
import { HMRPayload, Plugin } from 'vite';
|
|
3
|
-
import { g as CustomEventMap, h as ViteNodeRunner, i as HMRPayload$1, H as HotContext } from './types-
|
|
3
|
+
import { g as CustomEventMap, h as ViteNodeRunner, i as HMRPayload$1, H as HotContext } from './types-6a15e0b9.js';
|
|
4
4
|
|
|
5
5
|
type EventType = string | symbol;
|
|
6
6
|
type Handler<T = unknown> = (event: T) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as Arrayable, C as CreateHotContextFunction, f as DebuggerOptions, D as DepsHandlingOptions, a as FetchFunction, F as FetchResult, H as HotContext, c as ModuleCache, M as ModuleCacheMap, N as Nullable, R as RawSourceMap, b as ResolveIdFunction, S as StartOfSourceMap, d as ViteNodeResolveId, V as ViteNodeRunnerOptions, e as ViteNodeServerOptions } from './types-
|
|
1
|
+
export { A as Arrayable, C as CreateHotContextFunction, f as DebuggerOptions, D as DepsHandlingOptions, a as FetchFunction, F as FetchResult, H as HotContext, c as ModuleCache, M as ModuleCacheMap, N as Nullable, R as RawSourceMap, b as ResolveIdFunction, S as StartOfSourceMap, d as ViteNodeResolveId, V as ViteNodeRunnerOptions, e as ViteNodeServerOptions } from './types-6a15e0b9.js';
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TransformResult, ViteDevServer } from 'vite';
|
|
2
|
-
import { f as DebuggerOptions, D as DepsHandlingOptions, e as ViteNodeServerOptions, F as FetchResult, d as ViteNodeResolveId, R as RawSourceMap } from './types-
|
|
2
|
+
import { f as DebuggerOptions, D as DepsHandlingOptions, e as ViteNodeServerOptions, F as FetchResult, d as ViteNodeResolveId, R as RawSourceMap } from './types-6a15e0b9.js';
|
|
3
3
|
|
|
4
4
|
declare class Debugger {
|
|
5
5
|
options: DebuggerOptions;
|
package/dist/source-map.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TransformResult } from 'vite';
|
|
2
|
-
import { R as RawSourceMap } from './types-
|
|
2
|
+
import { R as RawSourceMap } from './types-6a15e0b9.js';
|
|
3
3
|
|
|
4
4
|
interface InstallSourceMapSupportOptions {
|
|
5
5
|
getSourceMap: (source: string) => RawSourceMap | null | undefined;
|
|
@@ -121,6 +121,18 @@ declare const DEFAULT_REQUEST_STUBS: {
|
|
|
121
121
|
};
|
|
122
122
|
updateStyle(id: string, css: string): void;
|
|
123
123
|
};
|
|
124
|
+
'@vite/client': {
|
|
125
|
+
injectQuery: (id: string) => string;
|
|
126
|
+
createHotContext(): {
|
|
127
|
+
accept: () => void;
|
|
128
|
+
prune: () => void;
|
|
129
|
+
dispose: () => void;
|
|
130
|
+
decline: () => void;
|
|
131
|
+
invalidate: () => void;
|
|
132
|
+
on: () => void;
|
|
133
|
+
};
|
|
134
|
+
updateStyle(id: string, css: string): void;
|
|
135
|
+
};
|
|
124
136
|
};
|
|
125
137
|
declare class ModuleCacheMap extends Map<string, ModuleCache> {
|
|
126
138
|
normalizePath(fsPath: string): string;
|
package/dist/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as Arrayable, C as CreateHotContextFunction, f as DebuggerOptions, D as DepsHandlingOptions, a as FetchFunction, F as FetchResult, H as HotContext, c as ModuleCache, M as ModuleCacheMap, N as Nullable, R as RawSourceMap, b as ResolveIdFunction, S as StartOfSourceMap, d as ViteNodeResolveId, V as ViteNodeRunnerOptions, e as ViteNodeServerOptions } from './types-
|
|
1
|
+
export { A as Arrayable, C as CreateHotContextFunction, f as DebuggerOptions, D as DepsHandlingOptions, a as FetchFunction, F as FetchResult, H as HotContext, c as ModuleCache, M as ModuleCacheMap, N as Nullable, R as RawSourceMap, b as ResolveIdFunction, S as StartOfSourceMap, d as ViteNodeResolveId, V as ViteNodeRunnerOptions, e as ViteNodeServerOptions } from './types-6a15e0b9.js';
|
package/dist/utils.cjs
CHANGED
|
@@ -22,8 +22,13 @@ function normalizeRequestId(id, base) {
|
|
|
22
22
|
const queryRE = /\?.*$/s;
|
|
23
23
|
const hashRE = /#.*$/s;
|
|
24
24
|
const cleanUrl = (url) => url.replace(hashRE, "").replace(queryRE, "");
|
|
25
|
+
const internalRequests = [
|
|
26
|
+
"@vite/client",
|
|
27
|
+
"@vite/env"
|
|
28
|
+
];
|
|
29
|
+
const internalRequestRegexp = new RegExp(`^/?(${internalRequests.join("|")})$`);
|
|
25
30
|
const isInternalRequest = (id) => {
|
|
26
|
-
return
|
|
31
|
+
return internalRequestRegexp.test(id);
|
|
27
32
|
};
|
|
28
33
|
function normalizeModuleId(id) {
|
|
29
34
|
return id.replace(/\\/g, "/").replace(/^\/@fs\//, isWindows ? "" : "/").replace(/^file:\//, "/").replace(/^node:/, "").replace(/^\/+/, "/");
|
package/dist/utils.d.ts
CHANGED
package/dist/utils.mjs
CHANGED
|
@@ -18,8 +18,13 @@ function normalizeRequestId(id, base) {
|
|
|
18
18
|
const queryRE = /\?.*$/s;
|
|
19
19
|
const hashRE = /#.*$/s;
|
|
20
20
|
const cleanUrl = (url) => url.replace(hashRE, "").replace(queryRE, "");
|
|
21
|
+
const internalRequests = [
|
|
22
|
+
"@vite/client",
|
|
23
|
+
"@vite/env"
|
|
24
|
+
];
|
|
25
|
+
const internalRequestRegexp = new RegExp(`^/?(${internalRequests.join("|")})$`);
|
|
21
26
|
const isInternalRequest = (id) => {
|
|
22
|
-
return
|
|
27
|
+
return internalRequestRegexp.test(id);
|
|
23
28
|
};
|
|
24
29
|
function normalizeModuleId(id) {
|
|
25
30
|
return id.replace(/\\/g, "/").replace(/^\/@fs\//, isWindows ? "" : "/").replace(/^file:\//, "/").replace(/^node:/, "").replace(/^\/+/, "/");
|