vite-node 3.0.0-beta.4 → 3.0.0
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/chunk-browser.cjs +4 -5
- package/dist/chunk-browser.mjs +4 -5
- package/dist/chunk-hmr.cjs +3 -3
- package/dist/chunk-hmr.mjs +4 -4
- package/dist/cli.cjs +3 -3
- package/dist/cli.mjs +4 -4
- package/dist/server.cjs +2 -2
- package/dist/server.mjs +3 -3
- package/package.json +2 -2
package/dist/chunk-browser.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
var f
|
|
4
|
+
var f = {
|
|
5
5
|
reset: [0, 0],
|
|
6
6
|
bold: [1, 22, "\x1B[22m\x1B[1m"],
|
|
7
7
|
dim: [2, 22, "\x1B[22m\x1B[2m"],
|
|
@@ -43,7 +43,7 @@ var f$1 = {
|
|
|
43
43
|
bgMagentaBright: [105, 49],
|
|
44
44
|
bgCyanBright: [106, 49],
|
|
45
45
|
bgWhiteBright: [107, 49]
|
|
46
|
-
}, h = Object.entries(f
|
|
46
|
+
}, h = Object.entries(f);
|
|
47
47
|
function a(n) {
|
|
48
48
|
return String(n);
|
|
49
49
|
}
|
|
@@ -78,7 +78,6 @@ function p(n = !1) {
|
|
|
78
78
|
return u;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
var f = p(!1);
|
|
81
|
+
var s = p();
|
|
83
82
|
|
|
84
|
-
exports.
|
|
83
|
+
exports.s = s;
|
package/dist/chunk-browser.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
var f
|
|
2
|
+
var f = {
|
|
3
3
|
reset: [0, 0],
|
|
4
4
|
bold: [1, 22, "\x1B[22m\x1B[1m"],
|
|
5
5
|
dim: [2, 22, "\x1B[22m\x1B[2m"],
|
|
@@ -41,7 +41,7 @@ var f$1 = {
|
|
|
41
41
|
bgMagentaBright: [105, 49],
|
|
42
42
|
bgCyanBright: [106, 49],
|
|
43
43
|
bgWhiteBright: [107, 49]
|
|
44
|
-
}, h = Object.entries(f
|
|
44
|
+
}, h = Object.entries(f);
|
|
45
45
|
function a(n) {
|
|
46
46
|
return String(n);
|
|
47
47
|
}
|
|
@@ -76,7 +76,6 @@ function p(n = !1) {
|
|
|
76
76
|
return u;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
var f = p(!1);
|
|
79
|
+
var s = p();
|
|
81
80
|
|
|
82
|
-
export {
|
|
81
|
+
export { s };
|
package/dist/chunk-hmr.cjs
CHANGED
|
@@ -114,7 +114,7 @@ async function fetchUpdate(runner, { path, acceptedPath }) {
|
|
|
114
114
|
fn(deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0));
|
|
115
115
|
}
|
|
116
116
|
const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
|
|
117
|
-
console.log(`${browser.
|
|
117
|
+
console.log(`${browser.s.cyan("[vite-node]")} hot updated: ${loggedPath}`);
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
function warnFailedFetch(err, path) {
|
|
@@ -138,7 +138,7 @@ async function handleMessage(runner, emitter, files, payload) {
|
|
|
138
138
|
if (update.type === "js-update") {
|
|
139
139
|
return queueUpdate(runner, fetchUpdate(runner, update));
|
|
140
140
|
}
|
|
141
|
-
console.error(`${browser.
|
|
141
|
+
console.error(`${browser.s.cyan("[vite-node]")} no support css hmr.}`);
|
|
142
142
|
return null;
|
|
143
143
|
})
|
|
144
144
|
);
|
|
@@ -165,7 +165,7 @@ async function handleMessage(runner, emitter, files, payload) {
|
|
|
165
165
|
await notifyListeners(runner, "vite:error", payload);
|
|
166
166
|
const err = payload.err;
|
|
167
167
|
console.error(
|
|
168
|
-
`${browser.
|
|
168
|
+
`${browser.s.cyan("[vite-node]")} Internal Server Error
|
|
169
169
|
${err.message}
|
|
170
170
|
${err.stack}`
|
|
171
171
|
);
|
package/dist/chunk-hmr.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
2
|
import createDebug from 'debug';
|
|
3
|
-
import {
|
|
3
|
+
import { s } from './chunk-browser.mjs';
|
|
4
4
|
import { normalizeRequestId } from './utils.mjs';
|
|
5
5
|
|
|
6
6
|
function createHmrEmitter() {
|
|
@@ -112,7 +112,7 @@ async function fetchUpdate(runner, { path, acceptedPath }) {
|
|
|
112
112
|
fn(deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0));
|
|
113
113
|
}
|
|
114
114
|
const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
|
|
115
|
-
console.log(`${
|
|
115
|
+
console.log(`${s.cyan("[vite-node]")} hot updated: ${loggedPath}`);
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
function warnFailedFetch(err, path) {
|
|
@@ -136,7 +136,7 @@ async function handleMessage(runner, emitter, files, payload) {
|
|
|
136
136
|
if (update.type === "js-update") {
|
|
137
137
|
return queueUpdate(runner, fetchUpdate(runner, update));
|
|
138
138
|
}
|
|
139
|
-
console.error(`${
|
|
139
|
+
console.error(`${s.cyan("[vite-node]")} no support css hmr.}`);
|
|
140
140
|
return null;
|
|
141
141
|
})
|
|
142
142
|
);
|
|
@@ -163,7 +163,7 @@ async function handleMessage(runner, emitter, files, payload) {
|
|
|
163
163
|
await notifyListeners(runner, "vite:error", payload);
|
|
164
164
|
const err = payload.err;
|
|
165
165
|
console.error(
|
|
166
|
-
`${
|
|
166
|
+
`${s.cyan("[vite-node]")} Internal Server Error
|
|
167
167
|
${err.message}
|
|
168
168
|
${err.stack}`
|
|
169
169
|
);
|
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.0
|
|
24
|
+
var version = "3.0.0";
|
|
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");
|
|
@@ -58,7 +58,7 @@ async function run(files, options = {}) {
|
|
|
58
58
|
process.exit(0);
|
|
59
59
|
}
|
|
60
60
|
if (!files.length) {
|
|
61
|
-
console.error(browser.
|
|
61
|
+
console.error(browser.s.red("No files specified."));
|
|
62
62
|
cli.version(version).outputHelp();
|
|
63
63
|
process.exit(1);
|
|
64
64
|
}
|
|
@@ -108,7 +108,7 @@ async function run(files, options = {}) {
|
|
|
108
108
|
});
|
|
109
109
|
if (options.watch) {
|
|
110
110
|
process.on("uncaughtException", (err) => {
|
|
111
|
-
console.error(browser.
|
|
111
|
+
console.error(browser.s.red("[vite-node] Failed to execute file: \n"), err);
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
import cac from 'cac';
|
|
3
|
-
import {
|
|
3
|
+
import { s } from './chunk-browser.mjs';
|
|
4
4
|
import { createServer, loadEnv } from 'vite';
|
|
5
5
|
import { ViteNodeRunner } from './client.mjs';
|
|
6
6
|
import { v as viteNodeHmrPlugin, a as createHotContext, h as handleMessage } from './chunk-hmr.mjs';
|
|
@@ -19,7 +19,7 @@ import 'node:perf_hooks';
|
|
|
19
19
|
import 'es-module-lexer';
|
|
20
20
|
import './constants.mjs';
|
|
21
21
|
|
|
22
|
-
var version = "3.0.0
|
|
22
|
+
var version = "3.0.0";
|
|
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");
|
|
@@ -56,7 +56,7 @@ async function run(files, options = {}) {
|
|
|
56
56
|
process.exit(0);
|
|
57
57
|
}
|
|
58
58
|
if (!files.length) {
|
|
59
|
-
console.error(
|
|
59
|
+
console.error(s.red("No files specified."));
|
|
60
60
|
cli.version(version).outputHelp();
|
|
61
61
|
process.exit(1);
|
|
62
62
|
}
|
|
@@ -106,7 +106,7 @@ async function run(files, options = {}) {
|
|
|
106
106
|
});
|
|
107
107
|
if (options.watch) {
|
|
108
108
|
process.on("uncaughtException", (err) => {
|
|
109
|
-
console.error(
|
|
109
|
+
console.error(s.red("[vite-node] Failed to execute file: \n"), err);
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
}
|
package/dist/server.cjs
CHANGED
|
@@ -51,11 +51,11 @@ class Debugger {
|
|
|
51
51
|
if (this.dumpDir) {
|
|
52
52
|
if (options.loadDumppedModules) {
|
|
53
53
|
console.info(
|
|
54
|
-
browser.
|
|
54
|
+
browser.s.gray(`[vite-node] [debug] load modules from ${this.dumpDir}`)
|
|
55
55
|
);
|
|
56
56
|
} else {
|
|
57
57
|
console.info(
|
|
58
|
-
browser.
|
|
58
|
+
browser.s.gray(`[vite-node] [debug] dump modules to ${this.dumpDir}`)
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
}
|
package/dist/server.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { performance } from 'node:perf_hooks';
|
|
|
4
4
|
import { pathToFileURL } from 'node:url';
|
|
5
5
|
import createDebug from 'debug';
|
|
6
6
|
import { resolve, join, extname, dirname, relative, normalize } from 'pathe';
|
|
7
|
-
import {
|
|
7
|
+
import { s } from './chunk-browser.mjs';
|
|
8
8
|
import * as esModuleLexer from 'es-module-lexer';
|
|
9
9
|
import { KNOWN_ASSET_RE } from './constants.mjs';
|
|
10
10
|
import { isNodeBuiltin, slash, findNearestPackageData, toArray, withTrailingSlash, normalizeModuleId, toFilePath } from './utils.mjs';
|
|
@@ -30,11 +30,11 @@ class Debugger {
|
|
|
30
30
|
if (this.dumpDir) {
|
|
31
31
|
if (options.loadDumppedModules) {
|
|
32
32
|
console.info(
|
|
33
|
-
|
|
33
|
+
s.gray(`[vite-node] [debug] load modules from ${this.dumpDir}`)
|
|
34
34
|
);
|
|
35
35
|
} else {
|
|
36
36
|
console.info(
|
|
37
|
-
|
|
37
|
+
s.gray(`[vite-node] [debug] dump modules to ${this.dumpDir}`)
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-node",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"description": "Vite as Node.js runtime",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@jridgewell/trace-mapping": "^0.3.25",
|
|
88
88
|
"@types/debug": "^4.1.12",
|
|
89
|
-
"tinyrainbow": "^
|
|
89
|
+
"tinyrainbow": "^2.0.0"
|
|
90
90
|
},
|
|
91
91
|
"scripts": {
|
|
92
92
|
"build": "rimraf dist && rollup -c",
|