Skip to content

Add opt-out config for dev dependency exclusion - #3877

Merged
eahefnawy merged 1 commit into
masterfrom
opt-out-for-dev-dependency-exclusion
Jun 30, 2017
Merged

eahefnawy merged 1 commit into
masterfrom
opt-out-for-dev-dependency-exclusion

Conversation

@pmuens

@pmuens pmuens commented Jun 29, 2017

Copy link
Copy Markdown
Contributor

What did you implement:

Refs #3827
Refs #3874
Refs #3869

Add the excludeDevDependencies config variable to the global package level.

This config variable defaults to true.

How did you implement it:

Added the config variable and added a check in the excludeDevDependencies() function.

How can we verify it:

Use the following package.json file:

{
  "name": "test-service",
  "version": "1.0.0",
  "main": "handler.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "node-fetch": "^1.7.1"
  },
  "devDependencies": {
    "ava": "^0.19.1",
    "babel-cli": "^6.24.1",
    "babel-core": "^6.25.0",
    "babel-preset-es2015": "^6.24.1",
    "browserify": "^14.4.0",
    "express": "^4.15.3",
    "jest": "^20.0.4",
    "mocha": "^3.4.2",
    "react": "^15.6.1",
    "react-native": "^0.45.1",
    "webpack": "^3.0.0"
  },
  "description": ""
}

Install the dependencies via npm install.

Run serverless package. After that run ls -lh <path-to-service-zip>. The size should be pretty small.

Add the following to your serverless.yml file:

package:
  excludeDevDependencies: false

Run serverless package. After that run ls -lh <path-to-service-zip>. The size should be pretty big.

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Update the messages below

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

@pmuens
pmuens force-pushed the opt-out-for-dev-dependency-exclusion branch from deb972d to 34595e1 Compare June 30, 2017 07:26

@eahefnawy eahefnawy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for that @pmuens ... works great 😊

@eahefnawy
eahefnawy merged commit 09651d8 into master Jun 30, 2017
@pmuens
pmuens deleted the opt-out-for-dev-dependency-exclusion branch June 30, 2017 14:42
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