From 0e807587e112b8ce8e0fdfd870e64e1452ce6dba Mon Sep 17 00:00:00 2001 From: Kenny Daniel Date: Fri, 2 Aug 2024 16:03:46 -0700 Subject: [PATCH] Prevent webpack from trying to include node fs --- src/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index c839143..d018ea3 100644 --- a/src/utils.js +++ b/src/utils.js @@ -73,7 +73,8 @@ export async function asyncBufferFromUrl(url) { * @returns {Promise} */ export async function asyncBufferFromFile(filename) { - const fs = await import('fs') + const fsPackage = 'fs' // webpack no include + const fs = await import(fsPackage) const stat = await fs.promises.stat(filename) return { byteLength: stat.size,