MCPcopy Create free account
hub / github.com/esengine/esengine / hasWasmFiles

Function hasWasmFiles

packages/editor-app/vite.config.ts:413–428  ·  view source on GitHub ↗

* 检查包目录是否包含 WASM 文件

(dirPath: string)

Source from the content-addressed store, hash-verified

411 * 检查包目录是否包含 WASM 文件
412 */
413function hasWasmFiles(dirPath: string): boolean {
414 try {
415 const files = fs.readdirSync(dirPath);
416 for (const file of files) {
417 if (file.endsWith('.wasm')) return true;
418 if (file === 'pkg') {
419 const pkgPath = path.join(dirPath, file);
420 const pkgFiles = fs.readdirSync(pkgPath);
421 if (pkgFiles.some(f => f.endsWith('.wasm'))) return true;
422 }
423 }
424 } catch {
425 // Ignore errors
426 }
427 return false;
428}
429
430/**
431 * 扫描 packages 目录检测 WASM 包

Callers 2

detectWasmPackagesFunction · 0.85
scanNodeModulesForWasmFunction · 0.85

Calls 2

joinMethod · 0.45
someMethod · 0.45

Tested by

no test coverage detected