@fudrouter/fsrouter 0.6.40 → 0.6.41
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/bin/cli.cjs +5 -3
- package/package.json +1 -1
package/bin/cli.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { spawn, exec, execSync } = require("child_process");
|
|
4
4
|
const path = require("path");
|
|
5
|
+
const { pathToFileURL } = require("node:url");
|
|
5
6
|
const fs = require("fs");
|
|
6
7
|
const https = require("https");
|
|
7
8
|
const os = require("os");
|
|
@@ -508,13 +509,14 @@ function startServer(latestVersion) {
|
|
|
508
509
|
function spawnServer() {
|
|
509
510
|
serverStartTime = Date.now();
|
|
510
511
|
crashLog = [];
|
|
511
|
-
// Resolve tsx loader path (works cross-platform; bare --import tsx fails on Windows
|
|
512
|
+
// Resolve tsx loader path (works cross-platform; bare --import tsx fails on Windows,
|
|
513
|
+
// absolute paths need file:// URL on Windows ESM loader)
|
|
512
514
|
let tsxImport;
|
|
513
515
|
try {
|
|
514
|
-
tsxImport = require.resolve("tsx/esm");
|
|
516
|
+
tsxImport = pathToFileURL(require.resolve("tsx/esm")).href;
|
|
515
517
|
} catch (_) {
|
|
516
518
|
try {
|
|
517
|
-
tsxImport = require.resolve("tsx");
|
|
519
|
+
tsxImport = pathToFileURL(require.resolve("tsx")).href;
|
|
518
520
|
} catch (_) {
|
|
519
521
|
tsxImport = "tsx";
|
|
520
522
|
}
|