Skip to content

Commit c616077

Browse files
authored
fix: scanner and optimizer should skip wasm (#9257)
1 parent aa0b921 commit c616077

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

packages/vite/src/node/optimizer/esbuildDepPlugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const externalTypes = [
2929
'stylus',
3030
'pcss',
3131
'postcss',
32+
// wasm
33+
'wasm',
3234
// known SFC types
3335
'vue',
3436
'svelte',

packages/vite/src/node/optimizer/scan.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,10 @@ function esbuildScanPlugin(
419419
// they are done after the bare import resolve because a package name
420420
// may end with these extensions
421421

422-
// css & json
422+
// css & json & wasm
423423
build.onResolve(
424424
{
425-
filter: /\.(css|less|sass|scss|styl|stylus|pcss|postcss|json)$/
425+
filter: /\.(css|less|sass|scss|styl|stylus|pcss|postcss|json|wasm)$/
426426
},
427427
externalUnlessEntry
428428
)

0 commit comments

Comments
 (0)