mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 19:16:29 +08:00
chore: switch to oxnode
This commit is contained in:
@@ -2,12 +2,11 @@
|
||||
import { spawn } from 'node:child_process';
|
||||
import { existsSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const scriptsFolder = join(fileURLToPath(import.meta.url), '..', '..');
|
||||
const scriptsSrcFolder = join(scriptsFolder, 'src');
|
||||
const projectRoot = join(scriptsFolder, '..', '..');
|
||||
const loader = join(scriptsFolder, 'register.js');
|
||||
|
||||
const [node, _self, file, ...options] = process.argv;
|
||||
|
||||
@@ -60,9 +59,7 @@ if (
|
||||
scriptLocation.endsWith('.ts') ||
|
||||
scriptLocation.startsWith(scriptsFolder)
|
||||
) {
|
||||
nodeOptions.unshift(`--import=${pathToFileURL(loader)}`);
|
||||
} else {
|
||||
nodeOptions.unshift('--experimental-specifier-resolution=node');
|
||||
nodeOptions.unshift(`--import=@oxc-node/core/register`);
|
||||
}
|
||||
|
||||
spawn(node, [...nodeOptions, scriptLocation, ...options], {
|
||||
|
||||
Reference in New Issue
Block a user