[wasm] fix: let vite ignore the dynamic import of node:fs

This commit is contained in:
鲁树人 2024-09-15 15:41:43 +01:00
parent 6a56cc8433
commit 7ac92f9341

View File

@ -11,7 +11,7 @@ function loader() {
const url = new URL('um_wasm_bg.wasm', import.meta.url);
const wasm =
url.protocol === 'file:'
? import('node:f' + 's/promises')
? import(/* @vite-ignore */ 'node:f' + 's/promises')
.then((fs) => fs.readFile(url))
.catch((err) => {
console.log('read wasm failed', err);