Skip to content

Exclude node_modules completely if deploying to google cloud functions, as GCF installs package.json. - #264

Merged
HyperBrain merged 4 commits into
serverless-heaven:masterfrom
debanjanbasu:master
Oct 31, 2017
Merged

HyperBrain merged 4 commits into
serverless-heaven:masterfrom
debanjanbasu:master

Conversation

@debanjanbasu

@debanjanbasu debanjanbasu commented Oct 30, 2017 •

Copy link
Copy Markdown
Contributor

Exclude node_modules completely if deploying to google cloud functions, as GCF installs package.json.

Added a check to see if the provider is Google

How can we verify it:

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@HyperBrain

HyperBrain commented Oct 30, 2017 •

Copy link
Copy Markdown
Member

Hi @debanjanbasu , thank you for the PR. Can you fill out the description template completely - especially the checkboxes and check "enable edits from maintainers" in your PR?

@HyperBrain HyperBrain left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a small semantical change :)

Comment thread lib/packExternalModules.js Outdated
});
// Copy modules only if not google-cloud-functions
// GCF Auto installs the package json
if (_.get(this.serverless, 'service.provider.name') !== 'google') {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer an early exit here if the provider is google instead of putting the default case into the if.

if (_.get(this.serverless, 'service.provider.name') === 'google') {
  return BbPromise.resolve();
}
...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this. I will add unit tests for the new behavior to restore coverage.

@HyperBrain
HyperBrain merged commit dbceb1b into serverless-heaven:master Oct 31, 2017
@HyperBrain

HyperBrain commented Nov 1, 2017 •

Copy link
Copy Markdown
Member

@debanjanbasu May I ask you for a favor? There is still the column for GCF missing in the provider compatibility chart (README). Would you mind to prepare a PR that adds the GCF status to the README?
I do not use Google, so I'm not able to check whether it works or not 😄
The main task for that is #128

jamesmbourne pushed a commit to jamesmbourne/serverless-webpack that referenced this pull request Oct 15, 2019
Exclude node_modules completely if deploying to google cloud functions, as GCF installs package.json.
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