Revert back to static import of fs, don't like to CJS bundles in package.json

This commit is contained in:
Vanilagy
2026-04-28 14:24:58 +02:00
parent 1fd99b5015
commit bf9e360587
5 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -692,7 +692,7 @@ export class FilePathTarget extends Target {
throw new TypeError('options must be an object.');
}
if (!node.getFs) {
if (!node.fs) {
throw new Error(
'FilePathTarget is only available in server-side environments (Node.js, Bun, Deno).',
);
@@ -703,7 +703,7 @@ export class FilePathTarget extends Target {
// Let's back this target with a StreamTarget, makes the implementation very simple
const writable = new WritableStream<StreamTargetChunk>({
start: async () => {
this._fileHandle = await (await node.getFs()).open(filePath, 'w');
this._fileHandle = await node.fs.open(filePath, 'w');
},
write: async (chunk) => {
assert(this._fileHandle);