fix(cli): run dev-web crash

This commit is contained in:
Alex Yang
2023-06-30 15:57:32 +08:00
parent 68c4fccf98
commit fd0c1da608
4 changed files with 18 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
"type": "module",
"private": true,
"bin": {
"dev-web": "./src/dev.mts"
"dev-web": "./src/dev.mjs"
},
"scripts": {
"start": "ts-node-esm ./src/dev.mjs"

16
packages/cli/src/dev.mjs Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env node
import { spawnSync } from 'node:child_process';
import { fileURLToPath } from 'node:url';
const child = spawnSync(
process.execPath,
[
'--loader',
'ts-node/esm/transpile-only',
fileURLToPath(new URL('./dev.ts', import.meta.url)),
...process.argv.slice(2),
],
{ stdio: 'inherit' }
);
if (child.status) process.exit(child.status);