Skip to content

Commit f05f946

Browse files
authored
fix: add vite-ignore comment inside dynamic crypto import (sveltejs#17623)
1 parent d7a8e3d commit f05f946

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/forty-worlds-attack.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: add vite-ignore comment inside dynamic crypto import

packages/svelte/src/internal/server/crypto.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export async function sha256(data) {
1313
? globalThis.crypto
1414
: // @ts-ignore - we don't install node types in the prod build
1515
// don't use 'node:crypto' because static analysers will think we rely on node when we don't
16-
(await import('node:' + 'crypto')).webcrypto;
16+
(await import(/* @vite-ignore */ 'node:' + 'crypto')).webcrypto;
1717

1818
const hash_buffer = await crypto.subtle.digest('SHA-256', text_encoder.encode(data));
1919

0 commit comments

Comments
 (0)