vite-node 2.0.0-beta.1 → 2.0.0-beta.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/README.md +5 -2
- package/dist/chunk-hmr.cjs +35 -18
- package/dist/chunk-hmr.mjs +35 -18
- package/dist/cli.cjs +17 -9
- package/dist/cli.d.ts +1 -1
- package/dist/cli.mjs +17 -9
- package/dist/client.cjs +79 -36
- package/dist/client.d.ts +1 -1
- package/dist/client.mjs +79 -36
- package/dist/constants.cjs +4 -1
- package/dist/constants.mjs +4 -1
- package/dist/hmr.d.ts +1 -1
- package/dist/{index-C38RQo3J.d.ts → index-D1EszD4V.d.ts} +6 -1
- package/dist/index.d.ts +1 -1
- package/dist/server.cjs +188 -92
- package/dist/server.d.ts +1 -1
- package/dist/server.mjs +189 -93
- package/dist/source-map.cjs +70 -35
- package/dist/source-map.mjs +70 -35
- package/dist/types.d.ts +1 -1
- package/dist/utils.cjs +43 -36
- package/dist/utils.d.ts +2 -4
- package/dist/utils.mjs +44 -35
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -55,6 +55,7 @@ If you prefer to write scripts that don't need to be passed into Vite Node, you
|
|
|
55
55
|
Simply add `#!/usr/bin/env vite-node --script` at the top of your file:
|
|
56
56
|
|
|
57
57
|
_file.ts_
|
|
58
|
+
|
|
58
59
|
```ts
|
|
59
60
|
#!/usr/bin/env vite-node --script
|
|
60
61
|
|
|
@@ -62,11 +63,13 @@ console.log('argv:', process.argv.slice(2))
|
|
|
62
63
|
```
|
|
63
64
|
|
|
64
65
|
And make the file executable:
|
|
66
|
+
|
|
65
67
|
```sh
|
|
66
68
|
chmod +x ./file.ts
|
|
67
69
|
```
|
|
68
70
|
|
|
69
71
|
Now, you can run the file without passing it into Vite Node:
|
|
72
|
+
|
|
70
73
|
```sh
|
|
71
74
|
$ ./file.ts hello
|
|
72
75
|
argv: [ 'hello' ]
|
|
@@ -145,7 +148,7 @@ const server = new ViteNodeServer(viteServer, {
|
|
|
145
148
|
debug: {
|
|
146
149
|
dumpModules: true,
|
|
147
150
|
loadDumppedModules: true,
|
|
148
|
-
}
|
|
151
|
+
},
|
|
149
152
|
})
|
|
150
153
|
```
|
|
151
154
|
|
|
@@ -163,7 +166,7 @@ Or programmatically:
|
|
|
163
166
|
import { ViteNodeRunner } from 'vite-node/client'
|
|
164
167
|
|
|
165
168
|
const runner = new ViteNodeRunner({
|
|
166
|
-
debug: true
|
|
169
|
+
debug: true,
|
|
167
170
|
})
|
|
168
171
|
```
|
|
169
172
|
|
package/dist/chunk-hmr.cjs
CHANGED
|
@@ -62,16 +62,18 @@ function sendMessageBuffer(runner, emitter) {
|
|
|
62
62
|
}
|
|
63
63
|
async function reload(runner, files) {
|
|
64
64
|
Array.from(runner.moduleCache.keys()).forEach((fsPath) => {
|
|
65
|
-
if (!fsPath.includes("node_modules"))
|
|
65
|
+
if (!fsPath.includes("node_modules")) {
|
|
66
66
|
runner.moduleCache.delete(fsPath);
|
|
67
|
+
}
|
|
67
68
|
});
|
|
68
69
|
return Promise.all(files.map((file) => runner.executeId(file)));
|
|
69
70
|
}
|
|
70
71
|
async function notifyListeners(runner, event, data) {
|
|
71
72
|
const maps = getCache(runner);
|
|
72
73
|
const cbs = maps.customListenersMap.get(event);
|
|
73
|
-
if (cbs)
|
|
74
|
+
if (cbs) {
|
|
74
75
|
await Promise.all(cbs.map((cb) => cb(data)));
|
|
76
|
+
}
|
|
75
77
|
}
|
|
76
78
|
async function queueUpdate(runner, p) {
|
|
77
79
|
const maps = getCache(runner);
|
|
@@ -100,8 +102,9 @@ async function fetchUpdate(runner, { path, acceptedPath }) {
|
|
|
100
102
|
);
|
|
101
103
|
if (isSelfUpdate || qualifiedCallbacks.length > 0) {
|
|
102
104
|
const disposer = maps.disposeMap.get(acceptedPath);
|
|
103
|
-
if (disposer)
|
|
105
|
+
if (disposer) {
|
|
104
106
|
await disposer(maps.dataMap.get(acceptedPath));
|
|
107
|
+
}
|
|
105
108
|
try {
|
|
106
109
|
[fetchedModule] = await reload(runner, [acceptedPath]);
|
|
107
110
|
} catch (e) {
|
|
@@ -109,15 +112,17 @@ async function fetchUpdate(runner, { path, acceptedPath }) {
|
|
|
109
112
|
}
|
|
110
113
|
}
|
|
111
114
|
return () => {
|
|
112
|
-
for (const { deps, fn } of qualifiedCallbacks)
|
|
115
|
+
for (const { deps, fn } of qualifiedCallbacks) {
|
|
113
116
|
fn(deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0));
|
|
117
|
+
}
|
|
114
118
|
const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
|
|
115
119
|
console.log(`${c.cyan("[vite-node]")} hot updated: ${loggedPath}`);
|
|
116
120
|
};
|
|
117
121
|
}
|
|
118
122
|
function warnFailedFetch(err, path) {
|
|
119
|
-
if (!err.message.match("fetch"))
|
|
123
|
+
if (!err.message.match("fetch")) {
|
|
120
124
|
console.error(err);
|
|
125
|
+
}
|
|
121
126
|
console.error(
|
|
122
127
|
`[hmr] Failed to reload ${path}. This could be due to syntax errors or importing non-existent modules. (see errors above)`
|
|
123
128
|
);
|
|
@@ -130,12 +135,15 @@ async function handleMessage(runner, emitter, files, payload) {
|
|
|
130
135
|
break;
|
|
131
136
|
case "update":
|
|
132
137
|
await notifyListeners(runner, "vite:beforeUpdate", payload);
|
|
133
|
-
await Promise.all(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
await Promise.all(
|
|
139
|
+
payload.updates.map((update) => {
|
|
140
|
+
if (update.type === "js-update") {
|
|
141
|
+
return queueUpdate(runner, fetchUpdate(runner, update));
|
|
142
|
+
}
|
|
143
|
+
console.error(`${c.cyan("[vite-node]")} no support css hmr.}`);
|
|
144
|
+
return null;
|
|
145
|
+
})
|
|
146
|
+
);
|
|
139
147
|
await notifyListeners(runner, "vite:afterUpdate", payload);
|
|
140
148
|
break;
|
|
141
149
|
case "full-reload":
|
|
@@ -150,16 +158,19 @@ async function handleMessage(runner, emitter, files, payload) {
|
|
|
150
158
|
await notifyListeners(runner, "vite:beforePrune", payload);
|
|
151
159
|
payload.paths.forEach((path) => {
|
|
152
160
|
const fn = maps.pruneMap.get(path);
|
|
153
|
-
if (fn)
|
|
161
|
+
if (fn) {
|
|
154
162
|
fn(maps.dataMap.get(path));
|
|
163
|
+
}
|
|
155
164
|
});
|
|
156
165
|
break;
|
|
157
166
|
case "error": {
|
|
158
167
|
await notifyListeners(runner, "vite:error", payload);
|
|
159
168
|
const err = payload.err;
|
|
160
|
-
console.error(
|
|
169
|
+
console.error(
|
|
170
|
+
`${c.cyan("[vite-node]")} Internal Server Error
|
|
161
171
|
${err.message}
|
|
162
|
-
${err.stack}`
|
|
172
|
+
${err.stack}`
|
|
173
|
+
);
|
|
163
174
|
break;
|
|
164
175
|
}
|
|
165
176
|
}
|
|
@@ -167,11 +178,13 @@ ${err.stack}`);
|
|
|
167
178
|
function createHotContext(runner, emitter, files, ownerPath) {
|
|
168
179
|
debugHmr("createHotContext", ownerPath);
|
|
169
180
|
const maps = getCache(runner);
|
|
170
|
-
if (!maps.dataMap.has(ownerPath))
|
|
181
|
+
if (!maps.dataMap.has(ownerPath)) {
|
|
171
182
|
maps.dataMap.set(ownerPath, {});
|
|
183
|
+
}
|
|
172
184
|
const mod = maps.hotModulesMap.get(ownerPath);
|
|
173
|
-
if (mod)
|
|
185
|
+
if (mod) {
|
|
174
186
|
mod.callbacks = [];
|
|
187
|
+
}
|
|
175
188
|
const newListeners = /* @__PURE__ */ new Map();
|
|
176
189
|
maps.ctxToListenersMap.set(ownerPath, newListeners);
|
|
177
190
|
function acceptDeps(deps, callback = () => {
|
|
@@ -211,7 +224,10 @@ function createHotContext(runner, emitter, files, ownerPath) {
|
|
|
211
224
|
maps.pruneMap.set(ownerPath, cb);
|
|
212
225
|
},
|
|
213
226
|
invalidate() {
|
|
214
|
-
notifyListeners(runner, "vite:invalidate", {
|
|
227
|
+
notifyListeners(runner, "vite:invalidate", {
|
|
228
|
+
path: ownerPath,
|
|
229
|
+
message: void 0
|
|
230
|
+
});
|
|
215
231
|
return reload(runner, files);
|
|
216
232
|
},
|
|
217
233
|
on(event, cb) {
|
|
@@ -226,8 +242,9 @@ function createHotContext(runner, emitter, files, ownerPath) {
|
|
|
226
242
|
off(event, cb) {
|
|
227
243
|
const removeFromMap = (map) => {
|
|
228
244
|
const existing = map.get(event);
|
|
229
|
-
if (existing === void 0)
|
|
245
|
+
if (existing === void 0) {
|
|
230
246
|
return;
|
|
247
|
+
}
|
|
231
248
|
const pruned = existing.filter((l) => l !== cb);
|
|
232
249
|
if (pruned.length === 0) {
|
|
233
250
|
map.delete(event);
|
package/dist/chunk-hmr.mjs
CHANGED
|
@@ -60,16 +60,18 @@ function sendMessageBuffer(runner, emitter) {
|
|
|
60
60
|
}
|
|
61
61
|
async function reload(runner, files) {
|
|
62
62
|
Array.from(runner.moduleCache.keys()).forEach((fsPath) => {
|
|
63
|
-
if (!fsPath.includes("node_modules"))
|
|
63
|
+
if (!fsPath.includes("node_modules")) {
|
|
64
64
|
runner.moduleCache.delete(fsPath);
|
|
65
|
+
}
|
|
65
66
|
});
|
|
66
67
|
return Promise.all(files.map((file) => runner.executeId(file)));
|
|
67
68
|
}
|
|
68
69
|
async function notifyListeners(runner, event, data) {
|
|
69
70
|
const maps = getCache(runner);
|
|
70
71
|
const cbs = maps.customListenersMap.get(event);
|
|
71
|
-
if (cbs)
|
|
72
|
+
if (cbs) {
|
|
72
73
|
await Promise.all(cbs.map((cb) => cb(data)));
|
|
74
|
+
}
|
|
73
75
|
}
|
|
74
76
|
async function queueUpdate(runner, p) {
|
|
75
77
|
const maps = getCache(runner);
|
|
@@ -98,8 +100,9 @@ async function fetchUpdate(runner, { path, acceptedPath }) {
|
|
|
98
100
|
);
|
|
99
101
|
if (isSelfUpdate || qualifiedCallbacks.length > 0) {
|
|
100
102
|
const disposer = maps.disposeMap.get(acceptedPath);
|
|
101
|
-
if (disposer)
|
|
103
|
+
if (disposer) {
|
|
102
104
|
await disposer(maps.dataMap.get(acceptedPath));
|
|
105
|
+
}
|
|
103
106
|
try {
|
|
104
107
|
[fetchedModule] = await reload(runner, [acceptedPath]);
|
|
105
108
|
} catch (e) {
|
|
@@ -107,15 +110,17 @@ async function fetchUpdate(runner, { path, acceptedPath }) {
|
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
112
|
return () => {
|
|
110
|
-
for (const { deps, fn } of qualifiedCallbacks)
|
|
113
|
+
for (const { deps, fn } of qualifiedCallbacks) {
|
|
111
114
|
fn(deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0));
|
|
115
|
+
}
|
|
112
116
|
const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
|
|
113
117
|
console.log(`${c.cyan("[vite-node]")} hot updated: ${loggedPath}`);
|
|
114
118
|
};
|
|
115
119
|
}
|
|
116
120
|
function warnFailedFetch(err, path) {
|
|
117
|
-
if (!err.message.match("fetch"))
|
|
121
|
+
if (!err.message.match("fetch")) {
|
|
118
122
|
console.error(err);
|
|
123
|
+
}
|
|
119
124
|
console.error(
|
|
120
125
|
`[hmr] Failed to reload ${path}. This could be due to syntax errors or importing non-existent modules. (see errors above)`
|
|
121
126
|
);
|
|
@@ -128,12 +133,15 @@ async function handleMessage(runner, emitter, files, payload) {
|
|
|
128
133
|
break;
|
|
129
134
|
case "update":
|
|
130
135
|
await notifyListeners(runner, "vite:beforeUpdate", payload);
|
|
131
|
-
await Promise.all(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
await Promise.all(
|
|
137
|
+
payload.updates.map((update) => {
|
|
138
|
+
if (update.type === "js-update") {
|
|
139
|
+
return queueUpdate(runner, fetchUpdate(runner, update));
|
|
140
|
+
}
|
|
141
|
+
console.error(`${c.cyan("[vite-node]")} no support css hmr.}`);
|
|
142
|
+
return null;
|
|
143
|
+
})
|
|
144
|
+
);
|
|
137
145
|
await notifyListeners(runner, "vite:afterUpdate", payload);
|
|
138
146
|
break;
|
|
139
147
|
case "full-reload":
|
|
@@ -148,16 +156,19 @@ async function handleMessage(runner, emitter, files, payload) {
|
|
|
148
156
|
await notifyListeners(runner, "vite:beforePrune", payload);
|
|
149
157
|
payload.paths.forEach((path) => {
|
|
150
158
|
const fn = maps.pruneMap.get(path);
|
|
151
|
-
if (fn)
|
|
159
|
+
if (fn) {
|
|
152
160
|
fn(maps.dataMap.get(path));
|
|
161
|
+
}
|
|
153
162
|
});
|
|
154
163
|
break;
|
|
155
164
|
case "error": {
|
|
156
165
|
await notifyListeners(runner, "vite:error", payload);
|
|
157
166
|
const err = payload.err;
|
|
158
|
-
console.error(
|
|
167
|
+
console.error(
|
|
168
|
+
`${c.cyan("[vite-node]")} Internal Server Error
|
|
159
169
|
${err.message}
|
|
160
|
-
${err.stack}`
|
|
170
|
+
${err.stack}`
|
|
171
|
+
);
|
|
161
172
|
break;
|
|
162
173
|
}
|
|
163
174
|
}
|
|
@@ -165,11 +176,13 @@ ${err.stack}`);
|
|
|
165
176
|
function createHotContext(runner, emitter, files, ownerPath) {
|
|
166
177
|
debugHmr("createHotContext", ownerPath);
|
|
167
178
|
const maps = getCache(runner);
|
|
168
|
-
if (!maps.dataMap.has(ownerPath))
|
|
179
|
+
if (!maps.dataMap.has(ownerPath)) {
|
|
169
180
|
maps.dataMap.set(ownerPath, {});
|
|
181
|
+
}
|
|
170
182
|
const mod = maps.hotModulesMap.get(ownerPath);
|
|
171
|
-
if (mod)
|
|
183
|
+
if (mod) {
|
|
172
184
|
mod.callbacks = [];
|
|
185
|
+
}
|
|
173
186
|
const newListeners = /* @__PURE__ */ new Map();
|
|
174
187
|
maps.ctxToListenersMap.set(ownerPath, newListeners);
|
|
175
188
|
function acceptDeps(deps, callback = () => {
|
|
@@ -209,7 +222,10 @@ function createHotContext(runner, emitter, files, ownerPath) {
|
|
|
209
222
|
maps.pruneMap.set(ownerPath, cb);
|
|
210
223
|
},
|
|
211
224
|
invalidate() {
|
|
212
|
-
notifyListeners(runner, "vite:invalidate", {
|
|
225
|
+
notifyListeners(runner, "vite:invalidate", {
|
|
226
|
+
path: ownerPath,
|
|
227
|
+
message: void 0
|
|
228
|
+
});
|
|
213
229
|
return reload(runner, files);
|
|
214
230
|
},
|
|
215
231
|
on(event, cb) {
|
|
@@ -224,8 +240,9 @@ function createHotContext(runner, emitter, files, ownerPath) {
|
|
|
224
240
|
off(event, cb) {
|
|
225
241
|
const removeFromMap = (map) => {
|
|
226
242
|
const existing = map.get(event);
|
|
227
|
-
if (existing === void 0)
|
|
243
|
+
if (existing === void 0) {
|
|
228
244
|
return;
|
|
245
|
+
}
|
|
229
246
|
const pruned = existing.filter((l) => l !== cb);
|
|
230
247
|
if (pruned.length === 0) {
|
|
231
248
|
map.delete(event);
|
package/dist/cli.cjs
CHANGED
|
@@ -20,7 +20,7 @@ require('node:url');
|
|
|
20
20
|
require('node:vm');
|
|
21
21
|
require('node:events');
|
|
22
22
|
|
|
23
|
-
var version = "2.0.0-beta.
|
|
23
|
+
var version = "2.0.0-beta.11";
|
|
24
24
|
|
|
25
25
|
const cli = cac("vite-node");
|
|
26
26
|
cli.option("-r, --root <path>", "Use specified root directory").option("-c, --config <path>", "Use specified config file").option("-m, --mode <mode>", "Set env mode").option("-w, --watch", 'Restart on file changes, similar to "nodemon"').option("--script", "Use vite-node as a script runner").option("--options <options>", "Use specified Vite server options").option("-v, --version", "Output the version number").option("-h, --help", "Display help for command");
|
|
@@ -39,7 +39,11 @@ async function run(files, options = {}) {
|
|
|
39
39
|
if (options.script) {
|
|
40
40
|
files = [files[0]];
|
|
41
41
|
options = {};
|
|
42
|
-
process.argv = [
|
|
42
|
+
process.argv = [
|
|
43
|
+
process.argv[0],
|
|
44
|
+
path.resolve(files[0]),
|
|
45
|
+
...process.argv.slice(2).filter((arg) => arg !== "--script" && arg !== files[0])
|
|
46
|
+
];
|
|
43
47
|
} else {
|
|
44
48
|
process.argv = [...process.argv.slice(0, 2), ...options["--"] || []];
|
|
45
49
|
}
|
|
@@ -66,9 +70,7 @@ async function run(files, options = {}) {
|
|
|
66
70
|
server: {
|
|
67
71
|
hmr: !!options.watch
|
|
68
72
|
},
|
|
69
|
-
plugins: [
|
|
70
|
-
options.watch && hmr.viteNodeHmrPlugin()
|
|
71
|
-
]
|
|
73
|
+
plugins: [options.watch && hmr.viteNodeHmrPlugin()]
|
|
72
74
|
});
|
|
73
75
|
await server$1.pluginContainer.buildStart({});
|
|
74
76
|
const node = new server.ViteNodeServer(server$1, serverOptions);
|
|
@@ -89,10 +91,12 @@ async function run(files, options = {}) {
|
|
|
89
91
|
}
|
|
90
92
|
});
|
|
91
93
|
await runner.executeId("/@vite/env");
|
|
92
|
-
for (const file of files)
|
|
94
|
+
for (const file of files) {
|
|
93
95
|
await runner.executeFile(file);
|
|
94
|
-
|
|
96
|
+
}
|
|
97
|
+
if (!options.watch) {
|
|
95
98
|
await server$1.close();
|
|
99
|
+
}
|
|
96
100
|
(_a = server$1.emitter) == null ? void 0 : _a.on("message", (payload) => {
|
|
97
101
|
hmr.handleMessage(runner, server$1.emitter, files, payload);
|
|
98
102
|
});
|
|
@@ -119,8 +123,12 @@ function parseServerOptions(serverOptions) {
|
|
|
119
123
|
},
|
|
120
124
|
transformMode: {
|
|
121
125
|
...serverOptions.transformMode,
|
|
122
|
-
ssr: utils.toArray((_f = serverOptions.transformMode) == null ? void 0 : _f.ssr).map(
|
|
123
|
-
|
|
126
|
+
ssr: utils.toArray((_f = serverOptions.transformMode) == null ? void 0 : _f.ssr).map(
|
|
127
|
+
(dep) => new RegExp(dep)
|
|
128
|
+
),
|
|
129
|
+
web: utils.toArray((_g = serverOptions.transformMode) == null ? void 0 : _g.web).map(
|
|
130
|
+
(dep) => new RegExp(dep)
|
|
131
|
+
)
|
|
124
132
|
}
|
|
125
133
|
};
|
|
126
134
|
}
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -18,7 +18,7 @@ import 'node:url';
|
|
|
18
18
|
import 'node:vm';
|
|
19
19
|
import 'node:events';
|
|
20
20
|
|
|
21
|
-
var version = "2.0.0-beta.
|
|
21
|
+
var version = "2.0.0-beta.11";
|
|
22
22
|
|
|
23
23
|
const cli = cac("vite-node");
|
|
24
24
|
cli.option("-r, --root <path>", "Use specified root directory").option("-c, --config <path>", "Use specified config file").option("-m, --mode <mode>", "Set env mode").option("-w, --watch", 'Restart on file changes, similar to "nodemon"').option("--script", "Use vite-node as a script runner").option("--options <options>", "Use specified Vite server options").option("-v, --version", "Output the version number").option("-h, --help", "Display help for command");
|
|
@@ -37,7 +37,11 @@ async function run(files, options = {}) {
|
|
|
37
37
|
if (options.script) {
|
|
38
38
|
files = [files[0]];
|
|
39
39
|
options = {};
|
|
40
|
-
process.argv = [
|
|
40
|
+
process.argv = [
|
|
41
|
+
process.argv[0],
|
|
42
|
+
resolve(files[0]),
|
|
43
|
+
...process.argv.slice(2).filter((arg) => arg !== "--script" && arg !== files[0])
|
|
44
|
+
];
|
|
41
45
|
} else {
|
|
42
46
|
process.argv = [...process.argv.slice(0, 2), ...options["--"] || []];
|
|
43
47
|
}
|
|
@@ -64,9 +68,7 @@ async function run(files, options = {}) {
|
|
|
64
68
|
server: {
|
|
65
69
|
hmr: !!options.watch
|
|
66
70
|
},
|
|
67
|
-
plugins: [
|
|
68
|
-
options.watch && viteNodeHmrPlugin()
|
|
69
|
-
]
|
|
71
|
+
plugins: [options.watch && viteNodeHmrPlugin()]
|
|
70
72
|
});
|
|
71
73
|
await server.pluginContainer.buildStart({});
|
|
72
74
|
const node = new ViteNodeServer(server, serverOptions);
|
|
@@ -87,10 +89,12 @@ async function run(files, options = {}) {
|
|
|
87
89
|
}
|
|
88
90
|
});
|
|
89
91
|
await runner.executeId("/@vite/env");
|
|
90
|
-
for (const file of files)
|
|
92
|
+
for (const file of files) {
|
|
91
93
|
await runner.executeFile(file);
|
|
92
|
-
|
|
94
|
+
}
|
|
95
|
+
if (!options.watch) {
|
|
93
96
|
await server.close();
|
|
97
|
+
}
|
|
94
98
|
(_a = server.emitter) == null ? void 0 : _a.on("message", (payload) => {
|
|
95
99
|
handleMessage(runner, server.emitter, files, payload);
|
|
96
100
|
});
|
|
@@ -117,8 +121,12 @@ function parseServerOptions(serverOptions) {
|
|
|
117
121
|
},
|
|
118
122
|
transformMode: {
|
|
119
123
|
...serverOptions.transformMode,
|
|
120
|
-
ssr: toArray((_f = serverOptions.transformMode) == null ? void 0 : _f.ssr).map(
|
|
121
|
-
|
|
124
|
+
ssr: toArray((_f = serverOptions.transformMode) == null ? void 0 : _f.ssr).map(
|
|
125
|
+
(dep) => new RegExp(dep)
|
|
126
|
+
),
|
|
127
|
+
web: toArray((_g = serverOptions.transformMode) == null ? void 0 : _g.web).map(
|
|
128
|
+
(dep) => new RegExp(dep)
|
|
129
|
+
)
|
|
122
130
|
}
|
|
123
131
|
};
|
|
124
132
|
}
|