Skip to content

Commit b1a8e58

Browse files
authored
refactor(plugin-legacy): optimize cspHashes array (#11734)
1 parent 00a79ec commit b1a8e58

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/plugin-legacy/src/index.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -797,10 +797,10 @@ function wrapIIFEBabelPlugin(): BabelPlugin {
797797
}
798798

799799
export const cspHashes = [
800-
createHash('sha256').update(safari10NoModuleFix).digest('base64'),
801-
createHash('sha256').update(systemJSInlineCode).digest('base64'),
802-
createHash('sha256').update(detectModernBrowserCode).digest('base64'),
803-
createHash('sha256').update(dynamicFallbackInlineCode).digest('base64'),
804-
]
800+
safari10NoModuleFix,
801+
systemJSInlineCode,
802+
detectModernBrowserCode,
803+
dynamicFallbackInlineCode,
804+
].map((i) => createHash('sha256').update(i).digest('base64'))
805805

806806
export default viteLegacyPlugin

0 commit comments

Comments
 (0)