Skip to content

Commit

Permalink
Merge pull request #21 from hlhr202/fix/swc
Browse files Browse the repository at this point in the history
fix: swc compatibility
  • Loading branch information
luckyadam authored Aug 30, 2024
2 parents a9ac48b + 15bbde6 commit c260a43
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export function getMockConfigs ({
})
if (mockFiles.length) {
const absMockFiles = mockFiles.map(file => path.join(mockDir, file))
helper.createBabelRegister({
let createRegister;
if ('createBabelRegister' in helper) createRegister = helper.createBabelRegister
if ('createSwcRegister' in helper) createRegister = helper.createSwcRegister
createRegister({
only: absMockFiles
})
absMockFiles.forEach(absFile => {
Expand Down

0 comments on commit c260a43

Please sign in to comment.