Fix relative module aliases for Windows (#1249)

* Fix relative module aliases for Windows

* Update regular expressions to use `path.sep` instead of `[\\/]`

* Make the minimal changes possible.
This commit is contained in:
Joe Lutz 2017-02-23 17:19:34 -06:00 committed by Arunoda Susiripala
parent 63e3262f2f
commit e3bf20cbcf

View file

@ -5,7 +5,9 @@
// This function returns paths relative to the top-level 'node_modules'
// directory found in the path. If none is found, returns the complete path.
const RELATIVE_START = 'node_modules/'
import { sep } from 'path'
const RELATIVE_START = `node_modules${sep}`
// Pass in the module's `require` object since it's module-specific.
export default (moduleRequire) => (path) => {