diff --git a/README.md b/README.md
index 9ff6b34..d582369 100644
--- a/README.md
+++ b/README.md
@@ -54,9 +54,6 @@ export default defineConfig({
## Known limitations
-- For now, the SRI hashes calculation is done only for inlined resources. This
- will be solved in future releases.
-
- For now, this integration only works for generated static content (the
exported subresource integrity hashes could be used in dynamic contexts, but
that does not cover the whole SSG use case)
@@ -65,6 +62,14 @@ export default defineConfig({
that if you need them to be up to date when you run `astro dev`, then you will
have to manually run `astro build`.
+- It seems that when a script is loaded with a _static_ import rather than
+ directly included with a ``,
- )
- inlineScriptHashes.add(sriHash)
- }
+ const elemRegex =
+ elemType === 'script'
+ ? /`
+ : ``,
+ )
+ extHashes.add(sriHash)
}
- // Computing hashes for inline styles without SRI hash
- {
- // Stateful object => we can use it to iterate over matches
- const styleRegex = /`,
- )
- inlineStyleHashes.add(sriHash)
- }
- }
- }
+ const inlineScriptHashes = /** @type {Set} */ (new Set())
+ const inlineStyleHashes = /** @type {Set} */ (new Set())
+ const extScriptHashes = /** @type {Set} */ (new Set())
+ const extStyleHashes = /** @type {Set} */ (new Set())
+
+ // Known Inline Resources (just a precaution)
+ extractKnownSriHashes(
+ /