UNPKG

832 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const cli_ux_1 = require("cli-ux");
4const rootDirs = [];
5const typeRoots = [`${__dirname}/../node_modules/@types`];
6function registerTSNode(debug, root) {
7 try {
8 debug('registering ts-node at', root);
9 const tsNode = require('ts-node');
10 typeRoots.push(`${root}/../node_modules/@types`);
11 rootDirs.push(`${root}/src`);
12 tsNode.register({
13 project: false,
14 // cache: false,
15 // typeCheck: true,
16 compilerOptions: {
17 target: 'esnext',
18 module: 'commonjs',
19 rootDirs,
20 typeRoots,
21 }
22 });
23 }
24 catch (err) {
25 cli_ux_1.default.warn(err);
26 }
27}
28exports.registerTSNode = registerTSNode;