Skip to content

Commit

Permalink
Merge pull request #8 from elsassph/fix/windows
Browse files Browse the repository at this point in the history
Hotfix for windows
  • Loading branch information
jasononeil authored Sep 15, 2017
2 parents f0f2d35 + bb38cd8 commit 38b1119
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions haxelib/Webpack.hx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ class Webpack {

#if macro
static function rebaseRelativePath(directory:String, file:String) {
// make base path relative
if (~/^(\/)|([A-Z]:)/i.match(directory)) {
var cwd = Sys.getCwd().replace('\\', '/');
if (directory.startsWith(cwd))
directory = './${directory.substr(cwd.length)}';
}

if (file.startsWith('./')) {
file = file.substr(2);
return './${directory}/${file}';
Expand Down

0 comments on commit 38b1119

Please sign in to comment.