Skip to content

Commit

Permalink
perf(cli): transpile only when using ts-node in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
B4nan committed Aug 9, 2020
1 parent fd1e158 commit f739f39
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/core/src/utils/ConfigurationLoader.ts
Expand Up @@ -61,14 +61,16 @@ export class ConfigurationLoader {
const tsConfigPath = path.join(process.cwd(), configPath);

// eslint-disable-next-line @typescript-eslint/no-var-requires
require('ts-node').register({ project: tsConfigPath });
require('ts-node').register({
project: tsConfigPath,
transpileOnly: true,
});

if (await pathExists(tsConfigPath)) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const tsConfig = require(tsConfigPath);

/* istanbul ignore next */
const paths = tsConfig?.compilerOptions?.paths;
const paths = tsConfig.compilerOptions?.paths;

if (paths) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
Expand Down

0 comments on commit f739f39

Please sign in to comment.