@@ -2,7 +2,7 @@ import net from 'node:net';
|
||||
import path from 'node:path';
|
||||
import {spawn} from 'node:child_process';
|
||||
import {existsSync, readFileSync} from 'node:fs';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import {fileURLToPath, pathToFileURL} from 'node:url';
|
||||
|
||||
const repoRoot = fileURLToPath(new URL('../', import.meta.url));
|
||||
const serverRoot = fileURLToPath(new URL('../server-node/', import.meta.url));
|
||||
@@ -13,6 +13,7 @@ const serverTsxCliPath = fileURLToPath(
|
||||
const serverTsxLoaderPath = fileURLToPath(
|
||||
new URL('../server-node/node_modules/tsx/dist/loader.mjs', import.meta.url),
|
||||
);
|
||||
const serverTsxLoaderUrl = pathToFileURL(serverTsxLoaderPath).href;
|
||||
const envExamplePath = fileURLToPath(new URL('../.env.example', import.meta.url));
|
||||
const envLocalPath = fileURLToPath(new URL('../.env.local', import.meta.url));
|
||||
const bundledNodePath = fileURLToPath(
|
||||
@@ -304,7 +305,7 @@ function registerChild(name, child, siblingProvider) {
|
||||
}
|
||||
|
||||
const serverProcess = existsSync(serverTsxLoaderPath)
|
||||
? spawn(runtimeNodePath, ['--watch', '--import', serverTsxLoaderPath, 'src/server.ts'], {
|
||||
? spawn(runtimeNodePath, ['--watch', '--import', serverTsxLoaderUrl, 'src/server.ts'], {
|
||||
cwd: serverRoot,
|
||||
env: mergedEnv,
|
||||
stdio: 'inherit',
|
||||
|
||||
Reference in New Issue
Block a user