Skip to content

Commit

Permalink
fix: use path.sep for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Feb 18, 2022
1 parent f162e71 commit d638da9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/babel-cli/src/babel/dir.ts
Expand Up @@ -203,14 +203,15 @@ export default async function ({
}),
);

const { sep } = path;
// determine base from the absolute file path
getBase = filename => {
const base = filenameToBaseMap.get(filename);
if (base !== undefined) {
return base;
}
for (const [absoluteFilenameOrDir, relative] of absoluteFilenames) {
if (filename.startsWith(absoluteFilenameOrDir + "/")) {
if (filename.startsWith(absoluteFilenameOrDir + sep)) {
filenameToBaseMap.set(filename, relative);
return relative;
}
Expand Down

0 comments on commit d638da9

Please sign in to comment.