Skip to content

Commit 1e25a2e

Browse files
atti187babel-bot
andauthored
Normalize absolute paths on Windows (#14187)
Co-authored-by: Babel Bot <[email protected]>
1 parent 4f7b91b commit 1e25a2e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages/babel-plugin-transform-runtime

packages/babel-plugin-transform-runtime/src/get-runtime-path/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ function resolveAbsoluteRuntime(moduleName: string, dirname: string) {
3434
}
3535

3636
export function resolveFSPath(path) {
37-
return require.resolve(path);
37+
return require.resolve(path).replace(/\\/g, "/");
3838
}

packages/babel-plugin-transform-runtime/test/fixtures/windows/absoluteRuntime/output.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var _asyncToGenerator = require("<CWD>\\packages\\babel-runtime\\helpers\\asyncToGenerator.js");
1+
var _asyncToGenerator = require("<CWD>/packages/babel-runtime/helpers/asyncToGenerator.js");
22

33
function test() {
44
return _test.apply(this, arguments);

0 commit comments

Comments
 (0)