Skip to content

Commit

Permalink
feat: tsconfig config property
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard committed Oct 11, 2022
1 parent f23e10f commit 1a7cc30
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/node/_core/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@ export interface PkgConfigOptions {
* Directory of source files.
*/
src?: string
tsconfig?: string
}
4 changes: 2 additions & 2 deletions src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export async function build(options: {
strict?: boolean
tsconfig?: string
}): Promise<void> {
const {cwd, strict = false, tsconfig = 'tsconfig.json'} = options
const {cwd, strict = false, tsconfig: tsconfigOption} = options

const pkg = await _loadPkgWithReporting({cwd})
const config = await _loadConfig({cwd})

const tsconfig = tsconfigOption || config?.tsconfig || 'tsconfig.json'
const ctx = await _resolveBuildContext({config, cwd, pkg, strict, tsconfig})

const buildTasks = _resolveBuildTasks(ctx)
Expand Down
3 changes: 2 additions & 1 deletion src/node/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ export async function check(options: {
strict?: boolean
tsconfig?: string
}): Promise<void> {
const {cwd, strict = false, tsconfig = 'tsconfig.json'} = options
const {cwd, strict = false, tsconfig: tsconfigOption} = options

const pkg = await _loadPkgWithReporting({cwd})
const config = await _loadConfig({cwd})
const tsconfig = tsconfigOption || config?.tsconfig || 'tsconfig.json'
const ctx = await _resolveBuildContext({config, cwd, pkg, strict, tsconfig})
const {logger} = ctx

Expand Down
3 changes: 2 additions & 1 deletion src/node/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function watch(options: {
strict?: boolean
tsconfig?: string
}): Promise<void> {
const {cwd, strict = false, tsconfig = 'tsconfig.json'} = options
const {cwd, strict = false, tsconfig: tsconfigOption} = options

const configFiles$ = await _watchConfigFiles({cwd})

Expand All @@ -28,6 +28,7 @@ export async function watch(options: {

const pkg = await _loadPkgWithReporting({cwd})
const config = await _loadConfig({cwd})
const tsconfig = tsconfigOption || config?.tsconfig || 'tsconfig.json'

return _resolveBuildContext({config, cwd, pkg, strict, tsconfig})
})
Expand Down

0 comments on commit 1a7cc30

Please sign in to comment.