add tsup run command?
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
use tsx
```
$ tsx --inpect-brk a.ts
```
may we can add tsup run command
```
$ tsup run --inpect-brk your.ts
```
-------------
implements from [tsx](https://github.com/esbuild-kit/tsx/)
npm
- cross-spaw
- @esbuild-kit/cjs-loader
- @esbuild-kit/esm-loader
- @esbuild-kit/core-utils
main file is run.ts
```
import type { StdioOptions } from 'child_process';
import { pathToFileURL } from 'url';
import spawn from 'cross-spawn';
export function run(
argv: string[],
options?: {
noCache?: boolean;
tsconfigPath?: string;
ipc?: boolean;
},
) {
const environment = { ...process.env };
const stdio: StdioOptions = [
'inherit', // stdin
'inherit', // stdout
'inherit', // stderr
'ipc', // parent-child communication
];
if (options) {
if (options.noCache) {
environment.ESBK_DISABLE_CACHE = '1';
}
if (options.tsconfigPath) {
environment.ESBK_TSCONFIG_PATH = options.tsconfigPath;
}
}
return spawn(
process.execPath,
[
'--require',
require.resolve('./preflight.cjs'),
'--loader',
pathToFileURL(require.resolve('./loader.js')).toString(),
...argv,
],
{
stdio,
env: environment,
},
);
}
```
Contributor guide
Assessment
This issue has not been assessed yet.