From 3f85a4a2f5eff5db239daddb7a00ee4e047df1cd Mon Sep 17 00:00:00 2001 From: kingcody Date: Wed, 26 Aug 2015 04:47:07 -0400 Subject: [PATCH] fix(gen): relativeRequire always returns posix style paths --- util.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util.js b/util.js index 6657cfc9f..adf494d96 100644 --- a/util.js +++ b/util.js @@ -88,8 +88,9 @@ function relativeRequire (self, to, fr) { fr = destinationPath(self, fr); to = destinationPath(self, to); return path.relative(path.dirname(fr), to) - .replace(/^(?!\.\.)(.*)/, './$1') - .replace(/[\/\\]index\.js$/, ''); + .replace(/\\/g, '/') // convert win32 separator to posix + .replace(/^(?!\.\.)(.*)/, './$1') // prefix non parent path with ./ + .replace(/[\/\\]index\.js$/, ''); // strip index.js suffix from path } function filterFile (template) {