tsrun/ts/index.ts

14 lines
265 B
TypeScript
Raw Normal View History

2018-06-04 21:25:19 +00:00
import * as tsNode from 'ts-node';
import * as path from 'path';
tsNode.register({
compilerOptions: {
2018-06-05 21:40:59 +00:00
lib: [ 'es2016', 'es2017' ]
2018-06-04 21:25:19 +00:00
}
});
2018-06-05 21:40:59 +00:00
if (process.env.CLI_CALL) {
const pathToLoad = path.join(process.cwd(), process.argv.pop());
import(pathToLoad);
}