Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion @kindspells/astro-shield/src/core.mts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,13 @@ export const updateStaticPageSriHashes = async (
const updatedSrc = src.startsWith(base)
? src.replace(base, '')
: src
const resourcePath = resolve(distDir, `.${updatedSrc}`)

// Prepare a relative path for resolve - depending on a trailing slash on base above
// after removing it, updatedSrc may or may not start with a slash
const resourcePath = resolve(
distDir,
updatedSrc.startsWith('/') ? `.${updatedSrc}` : updatedSrc,
)
resourceContent = await readFile(resourcePath)
} else {
// TODO: should we remove the element?
Expand Down