Skip to content

Commit

Permalink
use path.resolve to connect file path
Browse files Browse the repository at this point in the history
  • Loading branch information
bolasblack committed May 3, 2017
1 parent e42aa88 commit f5be30d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ export default class OfflinePlugin {
relativeBase = relativeBase + '/';
}

tool.basePath = relativeBase[0] === '.' ? relativeBase : './' + relativeBase;
tool.basePath = relativeBase[0] === '.' ? relativeBase : path.resolve('./', relativeBase);
} else if (this.publicPath) {
tool.basePath = this.publicPath.replace(/\/$/, '') + '/';
}
Expand Down Expand Up @@ -698,7 +698,7 @@ export default class OfflinePlugin {
return _path;
}

return tool.basePath + _path;
return path.resolve(tool.basePath, _path);
});
} else {
tool.pathRewrite = (path => {
Expand Down Expand Up @@ -726,7 +726,7 @@ export default class OfflinePlugin {
return key;
}

return this.publicPath + key.replace(/^\.?\//, '');
return path.resolve(this.publicPath, key.replace(/^\.?\//, ''));
});
}

Expand Down

0 comments on commit f5be30d

Please sign in to comment.