fix(cli): missing wasm files in artifacts command (#1884)

This commit is contained in:
LongYinan 2024-01-02 12:33:13 +08:00 committed by GitHub
parent 03eb476cef
commit c73cb31c11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -120,7 +120,11 @@ export async function collectArtifacts(userOptions: ArtifactsOptions) {
async function collectNodeBinaries(root: string) { async function collectNodeBinaries(root: string) {
const files = await readdirAsync(root, { withFileTypes: true }) const files = await readdirAsync(root, { withFileTypes: true })
const nodeBinaries = files const nodeBinaries = files
.filter((file) => file.isFile() && file.name.endsWith('.node')) .filter(
(file) =>
file.isFile() &&
(file.name.endsWith('.node') || file.name.endsWith('.wasm')),
)
.map((file) => join(root, file.name)) .map((file) => join(root, file.name))
const dirs = files.filter((file) => file.isDirectory()) const dirs = files.filter((file) => file.isDirectory())