@bleed-believer/path-alias
Version:
Assign path alias using tsconfig.json file
52 lines (51 loc) • 1.71 kB
JavaScript
import { fileURLToPath, pathToFileURL } from "url";
import { isAbsolute, join, resolve } from "path";
import { spawn } from "child_process";
export class NodeLauncher {
static
static get loaderPath() {
return NodeLauncher.
}
get targetPath() {
return this.
}
get targetArgs() {
return this.
}
constructor(targetPath, targetArgs, inject){
this.
this.
this.
this.
}
initialize(watch) {
return new Promise((resolve, reject)=>{
try {
const args = [
'--import',
NodeLauncher.loaderPath,
this.
...this.
];
if (watch) {
args.unshift('--watch');
}
const proc = this.
stdio: 'inherit'
});
proc.on('close', (___)=>{
resolve();
});
proc.on('error', (err)=>{
reject(err);
});
} catch (err) {
reject(err);
}
});
}
}