When we bundle a node se…

less than 1 minute read

When we bundle a node service in our app, I’d like to only include the node modules that that service actually uses. I’ve been using generate-package-json-webpack-plugin to generate a new package.json file from the actual code in the service. It works pretty good most of the time, but there are certain dependencies it will leave out. I believe it has to do with the way they are imported in the modules.

Has anyone solved this problem of only bundling the deps that are required? or do you just bundle the entire node_modules dir that is in the root

Updated: