Skip to content

Commit

Permalink
ffmpeg: allow import in nodejs (#577)
Browse files Browse the repository at this point in the history
* Add empty node module

* Switch to empty.mts
  • Loading branch information
Elia872 authored Oct 9, 2023
1 parent 6386757 commit 26f0e48
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/ffmpeg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
"exports": {
".": {
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/umd/ffmpeg.js"
"node": "./dist/esm/empty.mjs",
"default": {
"import": "./dist/esm/index.js",
"require": "./dist/umd/ffmpeg.js"
}
}
},
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions packages/ffmpeg/src/empty.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// File to be imported in node enviroments

export class FFmpeg {
constructor() {
throw new Error("ffmpeg.wasm does not support nodejs");
}
}

0 comments on commit 26f0e48

Please sign in to comment.