mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 19:33:51 +02:00
Add special .node.cjs variant for CJS support
This commit is contained in:
+2
-2
@@ -959,7 +959,7 @@ export class FilePathSource extends PathedSource {
|
||||
throw new TypeError('options.maxCacheSize, when provided, must be a non-negative number.');
|
||||
}
|
||||
|
||||
if (!node.getFs) {
|
||||
if (!node.fs) {
|
||||
throw new Error(
|
||||
'FilePathSource is only available in server-side environments (Node.js, Bun, Deno).',
|
||||
);
|
||||
@@ -970,7 +970,7 @@ export class FilePathSource extends PathedSource {
|
||||
// Let's back this source with a StreamSource, makes the implementation very simple
|
||||
this._streamSource = new StreamSource({
|
||||
getSize: async () => {
|
||||
this._fileHandle = await (await node.getFs()).open(filePath, 'r');
|
||||
this._fileHandle = await node.fs.open(filePath, 'r');
|
||||
|
||||
const stats = await this._fileHandle.stat();
|
||||
return stats.size;
|
||||
|
||||
Reference in New Issue
Block a user