Skip to content

Commit f5be30d

Browse files
committed
use path.resolve to connect file path
1 parent e42aa88 commit f5be30d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ export default class OfflinePlugin {
669669
relativeBase = relativeBase + '/';
670670
}
671671

672-
tool.basePath = relativeBase[0] === '.' ? relativeBase : './' + relativeBase;
672+
tool.basePath = relativeBase[0] === '.' ? relativeBase : path.resolve('./', relativeBase);
673673
} else if (this.publicPath) {
674674
tool.basePath = this.publicPath.replace(/\/$/, '') + '/';
675675
}
@@ -698,7 +698,7 @@ export default class OfflinePlugin {
698698
return _path;
699699
}
700700

701-
return tool.basePath + _path;
701+
return path.resolve(tool.basePath, _path);
702702
});
703703
} else {
704704
tool.pathRewrite = (path => {
@@ -726,7 +726,7 @@ export default class OfflinePlugin {
726726
return key;
727727
}
728728

729-
return this.publicPath + key.replace(/^\.?\//, '');
729+
return path.resolve(this.publicPath, key.replace(/^\.?\//, ''));
730730
});
731731
}
732732

0 commit comments

Comments
 (0)