Skip to content

Commit

Permalink
fix: improve removing of all FOUC buster <link>
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Sep 23, 2024
1 parent c02a262 commit df033dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vike/client/shared/removeFoucBuster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ function clean() {
injectedByVike.forEach((linkVike) => {
const href = linkVike.getAttribute('href')
assert(href && href.endsWith(suffix))
const filePathAbsoluteUserRootDir = href.slice(0, -suffix.length)
let filePathAbsoluteUserRootDir = href.slice(0, -suffix.length)
const prefix = '/@fs/'
if (filePathAbsoluteUserRootDir.startsWith(prefix))
filePathAbsoluteUserRootDir = filePathAbsoluteUserRootDir.slice(prefix.length)
if (
injectedByVite.some((filePathAbsoluteFilesystem) =>
filePathAbsoluteFilesystem.endsWith(filePathAbsoluteUserRootDir)
Expand Down

0 comments on commit df033dd

Please sign in to comment.