9 lines
223 B
JavaScript
9 lines
223 B
JavaScript
export function publicPath(relativePath) {
|
|
if (!relativePath) {
|
|
return relativePath
|
|
}
|
|
|
|
const path = relativePath.replace(/^\.\//, '').replace(/^\//, '')
|
|
return `${import.meta.env.BASE_URL}${path}`
|
|
}
|