Skip to content

Commit

Permalink
Added SWCRC env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
candunaj committed Nov 24, 2022
1 parent ef8f5b1 commit 02c0725
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/register/register.ts
Expand Up @@ -41,7 +41,14 @@ export function compile(
}
return outputText
} else {
const { code, map } = transformSync(sourcecode, filename, tsCompilerOptionsToSwcConfig(options, filename))
const swcRegisterConfig = tsCompilerOptionsToSwcConfig(options, filename)
if (process.env.SWCRC) {
// when SWCRC environment variable is set to true it will use swcrc file
swcRegisterConfig.swc = {
swcrc: true,
}
}
const { code, map } = transformSync(sourcecode, filename, swcRegisterConfig)
// in case of map is undefined
if (map) {
SourcemapMap.set(filename, map)
Expand Down

0 comments on commit 02c0725

Please sign in to comment.