vite-node 3.0.6 → 3.0.8
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 -3
- package/dist/cli.cjs +4 -2
- package/dist/cli.mjs +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ Note that when using the `--script` option, Vite Node forwards every argument an
|
|
|
82
82
|
In Vite Node, the server and runner (client) are separated, so you can integrate them in different contexts (workers, cross-process, or remote) if needed. The demo below shows a simple example of having both (server and runner) running in the same context
|
|
83
83
|
|
|
84
84
|
```ts
|
|
85
|
-
import { createServer } from 'vite'
|
|
85
|
+
import { createServer, version as viteVersion } from 'vite'
|
|
86
86
|
import { ViteNodeRunner } from 'vite-node/client'
|
|
87
87
|
import { ViteNodeServer } from 'vite-node/server'
|
|
88
88
|
import { installSourcemapsSupport } from 'vite-node/source-map'
|
|
@@ -94,8 +94,10 @@ const server = await createServer({
|
|
|
94
94
|
disabled: true,
|
|
95
95
|
},
|
|
96
96
|
})
|
|
97
|
-
// this is need to initialize the plugins
|
|
98
|
-
|
|
97
|
+
// For old Vite, this is need to initialize the plugins.
|
|
98
|
+
if (Number(viteVersion.split('.')[0]) < 6) {
|
|
99
|
+
await server.pluginContainer.buildStart({})
|
|
100
|
+
}
|
|
99
101
|
|
|
100
102
|
// create vite-node server
|
|
101
103
|
const node = new ViteNodeServer(server)
|
package/dist/cli.cjs
CHANGED
|
@@ -21,7 +21,7 @@ require('es-module-lexer');
|
|
|
21
21
|
require('./constants.cjs');
|
|
22
22
|
require('node:events');
|
|
23
23
|
|
|
24
|
-
var version = "3.0.
|
|
24
|
+
var version = "3.0.8";
|
|
25
25
|
|
|
26
26
|
const cli = cac("vite-node");
|
|
27
27
|
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");
|
|
@@ -74,7 +74,9 @@ async function run(files, options = {}) {
|
|
|
74
74
|
},
|
|
75
75
|
plugins: [options.watch && hmr.viteNodeHmrPlugin()]
|
|
76
76
|
});
|
|
77
|
-
|
|
77
|
+
if (Number(vite.version.split(".")[0]) < 6) {
|
|
78
|
+
await server$1.pluginContainer.buildStart({});
|
|
79
|
+
}
|
|
78
80
|
const env = vite.loadEnv(server$1.config.mode, server$1.config.envDir, "");
|
|
79
81
|
for (const key in env) {
|
|
80
82
|
(_a = process.env)[key] ?? (_a[key] = env[key]);
|
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
import cac from 'cac';
|
|
3
3
|
import { s } from './chunk-browser.mjs';
|
|
4
|
-
import { createServer, loadEnv } from 'vite';
|
|
4
|
+
import { createServer, version as version$1, loadEnv } from 'vite';
|
|
5
5
|
import { ViteNodeRunner } from './client.mjs';
|
|
6
6
|
import { ViteNodeServer } from './server.mjs';
|
|
7
7
|
import { installSourcemapsSupport } from './source-map.mjs';
|
|
@@ -19,7 +19,7 @@ import 'es-module-lexer';
|
|
|
19
19
|
import './constants.mjs';
|
|
20
20
|
import 'node:events';
|
|
21
21
|
|
|
22
|
-
var version = "3.0.
|
|
22
|
+
var version = "3.0.8";
|
|
23
23
|
|
|
24
24
|
const cli = cac("vite-node");
|
|
25
25
|
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");
|
|
@@ -72,7 +72,9 @@ async function run(files, options = {}) {
|
|
|
72
72
|
},
|
|
73
73
|
plugins: [options.watch && viteNodeHmrPlugin()]
|
|
74
74
|
});
|
|
75
|
-
|
|
75
|
+
if (Number(version$1.split(".")[0]) < 6) {
|
|
76
|
+
await server.pluginContainer.buildStart({});
|
|
77
|
+
}
|
|
76
78
|
const env = loadEnv(server.config.mode, server.config.envDir, "");
|
|
77
79
|
for (const key in env) {
|
|
78
80
|
(_a = process.env)[key] ?? (_a[key] = env[key]);
|