DEV Community

Discussion on: Cleanup the node_modules for a lighter Lambda Function

Collapse
 
abhishekshetty profile image
abhishekshetty

Won't it be better to use Webpack additionally. It minifies and does treeshaking and will bring down the size to a much small size.

Collapse
 
solegaonkar profile image
Vikas Solegaonkar

Thanks for your input. I found webpack messed it up when there was non js dependency. Did you see this problem? How did you overcome that?

Collapse
 
lal12 profile image
Luca Adrian L

It is true that this can be a bit tricky, since there isn't a universal way for every kind and type of non js dependency. But there is one way or another for every one. For most cases e.g. there is a generic or specific webpack loader. And I personally rarely experienced such thing. Mostly regarding native modules for which there is a webpack loader, but might require special handling for Lambda one way or another.