serverless-webpack
serverless-webpack copied to clipboard
Transitive externals cause packaging to fail
This is a bug report
Description
We mark some native node packages as externals because they cannot be bundled as webpack. However, if the package is transitively required by another package and not directly required as a dependency, yarn install --frozen-lockfile
will fail and say that the lock file needs to be updated when the module is packaged.
Previously, we just added this directly to our dependencies, but as was noted in a depcheck issue, we probably shouldn't do this to verify that the version is correct, and that it's actually needed by the package.
Not really sure how to solve this.
Related:
- depcheck/depcheck#566 (closed in favor of this)
I've no idea how to fix it either. Maybe you can create a small and simple project so we'll be able to reproduce the bug?
In this specific example we were using synchronized-promise which depends on deasync, a native module. Don't really have the time to set up a small example but maybe someone else might be able to help out.