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:
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)
It would appear that when using
serverless-plugin-monorepo
if your service package.json has adevDependency
which also happens to be a non-devdependency
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 thedevDependency
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)