Worker size-limit a problem?

I just hit the 1MB limit by adding the “request” package, which is required by quite a lot of node-js package ~40k packages - starting to think that for advanced apps - Cloudflare workers won’t save much time since we’ll need to write our own libraries…

Maybe Cloudflare can include some standard packages by default?

Update: I’m assuming someone will say “But you can use the new easier ES6 .fetch() API”, sure - but then i still can’t use battle-tested parsers like node-soap that depend on the “request” package for all requests.

Adding a minification step to your build process can be a good way to get around the 1MB limit.

That is a single dependency, packed with webpack.

Yep, I understand! Are you running it with the minification option?

Yes, the “production” mode.

It’s really impressive that a single library is hitting the limit, I can only imagine how much unused code it is including. Is there perhaps a similar option which was designed to work in the browser rather than Node? They tend to be significantly smaller.

Yes there is, Needle is much faster, smaller, better, easier also handles XML. But there’s no SOAP library that use it and very few other “libraries” that do, they seem to gather around request package.

This is a very annoying part of javascript, it’s too bad it can’t be removed when minifying.

Sadly, I have the same issue here after trying use aws-sdk to integrate with lambda, any suggestions? thank you.


Saved my own ■■■ by importing individual services, such as:
var Lambda = require(‘aws-sdk/clients/lambda’);