I wrote a set of functions and I want to create a zip file containing all stuff necessary for production. So I want to exclude all stuff used for dev (Nothing from devDependencies).
Why do I need to create the ZIP? I know that It's possible to install dependencies in the server, but serverless platforms are expecting a zip with all dependencies included to avoid long time start-ups (cold start). Also, I want to integrate the deployment with Terraform.
The problem is that all solutions that I found googling don't exclude dev dependencies and transitive dev dependencies automatically. Basically, they take all from node_modules and the root and make a zip, including stuff that is not necessary for production, like unit test and tools used for developing.
I'm looking something like:
- sbt-assembly or sbt-native-packager in Scala.
- Maven Shade Plugin or Maven Assembly Plugin in Java.
- python3 setup.py sdist bdist_wheel in Python.
Important: I don't want a solution where I need to manually specify the list of dependencies to exclude. I have this information in the package.json and the method should use this information to know what to put in the zip file.