From e3bf20cbcf43ff3a062afc1c70e983e75e041895 Mon Sep 17 00:00:00 2001 From: Joe Lutz Date: Thu, 23 Feb 2017 17:19:34 -0600 Subject: [PATCH] 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. --- server/build/root-module-relative-path.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/build/root-module-relative-path.js b/server/build/root-module-relative-path.js index 84de5c25..54557a81 100644 --- a/server/build/root-module-relative-path.js +++ b/server/build/root-module-relative-path.js @@ -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) => {