ffmpeg: allow import in nodejs (#577)

* Add empty node module

* Switch to empty.mts
This commit is contained in:
Elia872 2023-10-09 15:37:08 +02:00 committed by GitHub
parent 6386757610
commit 26f0e482da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -7,8 +7,11 @@
"exports": { "exports": {
".": { ".": {
"types": "./dist/esm/index.d.ts", "types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.js", "node": "./dist/esm/empty.mjs",
"require": "./dist/umd/ffmpeg.js" "default": {
"import": "./dist/esm/index.js",
"require": "./dist/umd/ffmpeg.js"
}
} }
}, },
"scripts": { "scripts": {

View File

@ -0,0 +1,7 @@
// File to be imported in node enviroments
export class FFmpeg {
constructor() {
throw new Error("ffmpeg.wasm does not support nodejs");
}
}