Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e3bf20c

Browse files
dizlexikarunoda
authored andcommitted
Fix relative module aliases for Windows (vercel#1249)
* Fix relative module aliases for Windows * Update regular expressions to use `path.sep` instead of `[\\/]` * Make the minimal changes possible.
1 parent 63e3262 commit e3bf20c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/build/root-module-relative-path.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
// This function returns paths relative to the top-level 'node_modules'
66
// directory found in the path. If none is found, returns the complete path.
77

8-
const RELATIVE_START = 'node_modules/'
8+
import { sep } from 'path'
9+
10+
const RELATIVE_START = `node_modules${sep}`
911

1012
// Pass in the module's `require` object since it's module-specific.
1113
export default (moduleRequire) => (path) => {

0 commit comments

Comments
 (0)