Node.js Optimizing application size

Viewed 92

I have a node.js server which I deploy using docker.

The docker contains my dist files (size: 1.3mb) and my node_modules files (size: 130mb)

I wanted reduce my docker image size and I've noticed that packages such as aws-sdk takes 50mb while I only use a small subset of this package (AWS.S3)

Is there a way to optimize the modules I take from each package or do I have to use webpack? and if I do need to use webpack to achieve this, is it best practice to use webpack on server?

0 Answers
Related