Skip to content

Commit 1e25a2e

Browse files
atti187babel-bot
andauthored
Normalize absolute paths on Windows (#14187)
Co-authored-by: Babel Bot <babel-bot@users.noreply.github.com>
1 parent 4f7b91b commit 1e25a2e

File tree

2 files changed

+2
-2
lines changed
  • packages/babel-plugin-transform-runtime

2 files changed

+2
-2
lines changed

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy