Skip to content

Commit

Permalink
Disable loading files from configuration (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey authored Oct 7, 2018
1 parent 9d15a72 commit df1ac1d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand All @@ -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))
}
Expand Down

0 comments on commit df1ac1d

Please sign in to comment.