Butterwire / serverless-plugin-monorepo

A Serverless plugin that allows use of serverless in a JS mono repo.
Mozilla Public License 2.0
167 stars 31 forks source link

Dev Dependencies in a service which are also core dependencies of a package are removed #14

Open duro opened 5 years ago

duro commented 5 years ago

It would appear that when using serverless-plugin-monorepo if your service package.json has a devDependency which also happens to be a non-dev dependency of another module, and the versions are the same (so they both rely on the module installed at the top of node_modules), what will happen is that the devDependency gets removed.

I have put together a reproduction case for this issue here:

https://github.com/duro/sls-devdep-repro

This caused us a big issue when deploying today, and we were forced to move the devDependency to dependencies in order to prevent it from getting stripped.

It would seem that Serverless Framework itself is doing something else under the hood, as it does not strip this dependency during it's own remove of devDependencies step (when serverless-plugin-monorepo is not used)