Skip to content

Conversation

@HyperBrain
Copy link
Member

What did you implement:

If you add a node module to the whitelist of node-externals, the module is bundled and the module's dependencies are added to the externals of the compiled chunk.
The current version of the plugin checks all externals against the production dependencies of the service, so the "new" externals are not found there and are missing in the deployed functions. The functions will crash with a missing modules exception.

This PR fixes the issue, and adds all transient dependencies to the functions in case a node module is bundled.

How did you implement it:

The packager now fetches the dependency tree of the service by using npm ls, tries to find the used module versions and adds them to the deployed module list.

The existing handling for first level modules that are present in the package.json has not been changed, so for the existing uses nothing special should be expected.

I tested it thoroughly with a combination of bundling some node modules fetched from VCS (GIT) - this would be the most prominent use case.

@HyperBrain HyperBrain added this to the 3.0.0 milestone Aug 9, 2017
@HyperBrain HyperBrain merged commit c6e76b4 into v3.0.0 Aug 9, 2017
@HyperBrain HyperBrain deleted the install-bundled-dependencies branch August 9, 2017 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants