Skip to content

Commit

Permalink
perf: use more performant url join impl (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
hulkish authored and gregberge committed Jun 5, 2019
1 parent 86171ec commit c3fbbef
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/server/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export const smartRequire = modulePath => {
return eval('module.require')(modulePath)
}

export const joinURLPath = (...paths) => {
const cleanPaths = paths.map(path => path.replace(/\/$/, ''))
return cleanPaths.join('/')
export const joinURLPath = (publicPath, filename) => {
if (publicPath.substr(-1) === '/') {
return `${publicPath}${filename}`
}

return `${publicPath}/${filename}`
}

0 comments on commit c3fbbef

Please sign in to comment.