From df1ac1d361b1bc02044ad98d4e05c81847d34c14 Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Sun, 7 Oct 2018 11:06:02 -0700 Subject: [PATCH] Disable loading `files` from configuration (#700) --- src/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index f04d025b4..9764a933a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -96,7 +96,7 @@ export const DEFAULTS: Options = { /** * Default TypeScript compiler options required by `ts-node`. */ -const DEFAULT_COMPILER_OPTIONS = { +const TS_NODE_COMPILER_OPTIONS = { sourceMap: true, inlineSourceMap: false, inlineSources: true, @@ -456,7 +456,7 @@ function readConfig ( project?: string | null, noProject?: boolean | null ): ts.ParsedCommandLine { - let config = { compilerOptions: {} } + let config: any = { compilerOptions: {} } let basePath = normalizeSlashes(cwd) let configFileName: string | undefined = undefined @@ -479,8 +479,12 @@ function readConfig ( } } + // Remove resolution of "files". + config.files = [] + config.includes = [] + // Override default configuration options `ts-node` requires. - config.compilerOptions = Object.assign({}, config.compilerOptions, compilerOptions, DEFAULT_COMPILER_OPTIONS) + config.compilerOptions = Object.assign({}, config.compilerOptions, compilerOptions, TS_NODE_COMPILER_OPTIONS) return fixConfig(ts.parseJsonConfigFileContent(config, ts.sys, basePath, undefined, configFileName)) }