Make Nitro build a specific package for browser runtime
I am trying to use
So after a lot of digging I've came across its
So I manually modified this require statement in
To force the package to use the browser implementation which doesn't use
Now to my question
I know that server packages are built using
@aws-sdk/client-s3 in Cloudflare workers but when the SDK instantiates S3Client it tries to load the configuration from multiple including file system which is not supported and throws fs.readFile is not implemented yet!So after a lot of digging I've came across its
package.json and it had these fieldsSo I manually modified this require statement in
node_modules\@aws-sdk\client-s3\dist-cjs\index.jsTo force the package to use the browser implementation which doesn't use
fs.readFileNow to my question
nitro which uses rollup I have tried all nitro configurations to change this require string at build time but with no avail. Is there a way to change this string or even instruct nitro to build @aws-sdk/client-s3 for browser environment?