1 | ;
|
2 |
|
3 | // eslint-disable-next-line node/no-deprecated-api
|
4 | if (!require.extensions['.ts']) {
|
5 | let options = { project: `${__dirname}/ts/tsconfig.json` };
|
6 |
|
7 | // If we're operating in the context of another project, which might happen
|
8 | // if someone has installed ember-cli-typescript from git, only perform
|
9 | // transpilation. In this case, we also overwrite the default ignore glob
|
10 | // (which ignores everything in `node_modules`) to instead ignore anything
|
11 | // that doesn't end with `.ts`.
|
12 | if (process.cwd() !== __dirname) {
|
13 | options.ignore = [/\.(?!ts$)\w+$/];
|
14 | options.transpileOnly = true;
|
15 | }
|
16 |
|
17 | // eslint-disable-next-line node/no-unpublished-require
|
18 | require('ts-node').register(options);
|
19 | }
|