Skip to content

Commit

Permalink
refactor(plugin-legacy): optimize cspHashes array (vitejs#11734)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluepower authored and futurGH committed Feb 26, 2023
1 parent 4c5785f commit 5a190b5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/plugin-legacy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -797,10 +797,10 @@ function wrapIIFEBabelPlugin(): BabelPlugin {
}

export const cspHashes = [
createHash('sha256').update(safari10NoModuleFix).digest('base64'),
createHash('sha256').update(systemJSInlineCode).digest('base64'),
createHash('sha256').update(detectModernBrowserCode).digest('base64'),
createHash('sha256').update(dynamicFallbackInlineCode).digest('base64'),
]
safari10NoModuleFix,
systemJSInlineCode,
detectModernBrowserCode,
dynamicFallbackInlineCode,
].map((i) => createHash('sha256').update(i).digest('base64'))

export default viteLegacyPlugin

0 comments on commit 5a190b5

Please sign in to comment.