Skip to content

Commit

Permalink
Merge pull request #745 from SukkaW/ignore-dynamic
Browse files Browse the repository at this point in the history
feat(core): support swc's `ignoreDynamic` option
  • Loading branch information
Brooooooklyn authored Jan 20, 2024
2 parents e4fcd32 + 0862975 commit 0e8eca2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface Options {
[from: string]: [string]
}
swc?: SwcOptions
ignoreDynamic?: boolean
}

function transformOption(path: string, options?: Options, jest = false): SwcOptions {
Expand Down Expand Up @@ -70,6 +71,7 @@ function transformOption(path: string, options?: Options, jest = false): SwcOpti
...(moduleType === 'commonjs' || moduleType === 'umd' || moduleType === 'amd'
? {
noInterop: !opts.esModuleInterop,
ignoreDynamic: opts.ignoreDynamic,
}
: undefined),
},
Expand Down
1 change: 1 addition & 0 deletions packages/register/read-default-tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export function tsCompilerOptionsToSwcConfig(options: ts.CompilerOptions, filena
((aliasPaths as string[]) ?? []).map((path) => resolve(options.baseUrl ?? './', path)),
]),
) as Options['paths'],
ignoreDynamic: Boolean(process.env.SWC_NODE_IGNORE_DYNAMIC),
swc: {
sourceRoot: options.sourceRoot,
inputSourceMap: options.inlineSourceMap,
Expand Down

0 comments on commit 0e8eca2

Please sign in to comment.