Skip to content

Commit

Permalink
fix: 相对路径
Browse files Browse the repository at this point in the history
  • Loading branch information
苏文雄 committed Jan 7, 2021
1 parent 572d413 commit 4afb822
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ydoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ const ydoc = {
}

importFilepath = path.isAbsolute(importFilepath)? importFilepath : path.resolve(ydoc.config.dist, importFilepath);
if(publicPath)return publicPath + importFilepath.substr(ydoc.config.dist.length);
if(publicPath){
if(path.extname(importFilepath) !== '.html'){
return publicPath + importFilepath.substr(ydoc.config.dist.length);
}
}
srcFilepath = path.isAbsolute(srcFilepath) ? srcFilepath : path.resolve(ydoc.config.dist, srcFilepath);
let rele = path.relative(srcFilepath, importFilepath);
return rele.substr(3);
Expand Down

0 comments on commit 4afb822

Please sign in to comment.