Prevent webpack from trying to include node fs

This commit is contained in:
Kenny Daniel 2024-08-02 16:03:46 -07:00
parent c6c79c05ca
commit 0e807587e1
No known key found for this signature in database
GPG Key ID: 90AB653A8CAD7E45

@ -73,7 +73,8 @@ export async function asyncBufferFromUrl(url) {
* @returns {Promise<AsyncBuffer>}
*/
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,