Skip to content

Commit 8aeb7ad

Browse files
committed
Fix babel loader detection on Windows
1 parent c1680d0 commit 8aeb7ad

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ class TranspileNodeModules {
6868
return pattern.includes(".js") || pattern.match(/\b(cjs|mjs|jsx?|tsx?)\b/);
6969
}
7070

71-
ruleUsesBabel({ use }) {
72-
return use && use.find(({ loader }) => loader.match(/(^|\/)babel-loader(\/|$)/));
71+
ruleUsesBabel({ use = [] }) {
72+
return use.some(({ loader }) =>
73+
loader.match(new RegExp(`(^|${slash})babel-loader(${slash}|$)`))
74+
);
7375
}
7476

7577
/**

0 commit comments

Comments
 (0)