Skip to content

Commit

Permalink
Merge pull request #650 from KitchenMate/hook-opts
Browse files Browse the repository at this point in the history
feat(register): support hook options
  • Loading branch information
Brooooooklyn authored Apr 27, 2022
2 parents 3062413 + 4c6dad7 commit f34801d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/register/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export function compile(
}
}

export function register(options = readDefaultTsConfig()) {
export function register(options = readDefaultTsConfig(), hookOpts = {}) {
installSourceMapSupport()
return addHook((code, filename) => compile(code, filename, options), {
exts: DEFAULT_EXTENSIONS,
...hookOpts,
})
}

0 comments on commit f34801d

Please sign in to comment.