{"action":"created","issue":{"url":"https://api.github.com/repos/serverless/serverless/issues/964","repository_url":"https://api.github.com/repos/serverless/serverless","labels_url":"https://api.github.com/repos/serverless/serverless/issues/964/labels{/name}","comments_url":"https://api.github.com/repos/serverless/serverless/issues/964/comments","events_url":"https://api.github.com/repos/serverless/serverless/issues/964/events","html_url":"https://github.com/serverless/serverless/issues/964","id":146534374,"number":964,"title":"How to reduce lambda function size","user":{"login":"nirmalgoswami","id":17105608,"avatar_url":"https://avatars.githubusercontent.com/u/17105608?v=3","gravatar_id":"","url":"https://api.github.com/users/nirmalgoswami","html_url":"https://github.com/nirmalgoswami","followers_url":"https://api.github.com/users/nirmalgoswami/followers","following_url":"https://api.github.com/users/nirmalgoswami/following{/other_user}","gists_url":"https://api.github.com/users/nirmalgoswami/gists{/gist_id}","starred_url":"https://api.github.com/users/nirmalgoswami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nirmalgoswami/subscriptions","organizations_url":"https://api.github.com/users/nirmalgoswami/orgs","repos_url":"https://api.github.com/users/nirmalgoswami/repos","events_url":"https://api.github.com/users/nirmalgoswami/events{/privacy}","received_events_url":"https://api.github.com/users/nirmalgoswami/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/serverless/serverless/labels/discussion","name":"discussion","color":"1d76db"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-04-07T07:35:03Z","updated_at":"2016-08-05T08:57:05Z","closed_at":"2016-08-05T08:57:05Z","body":"so many people have this issue so i am creating this issue for discussion\r\n\r\nsuppose you are using lots of third party module which are located in `node-modules` \r\n\r\nbut in some case lambda function require two or three third party module,how to include only few of them in lambda function\r\n\r\n`serverless-optimizer-plugin` can solve issue but it have issue like parent folder does not support right now see [bug](https://github.com/serverless/serverless-optimizer-plugin/issues/29)\r\n\r\n\r\nwe can use like this\r\n`s-function.json`\r\n\r\n```\r\n\"custom\": {\r\n    \"excludePatterns\": [],\r\n    \"envVars\": [],\r\n    \"optimize \": {\r\n      \"exclude\": [\r\n        \"aws-sdk\",\r\n        \"mysql\"\r\n      ],\r\n      \"includePaths\": [\r\n        \"../node_modules/abc\",\r\n        \"../node_modules/pqr\"\r\n      ]\r\n    }\r\n\r\n  },\r\n```\r\n\r\nbut `serverless-optimizer-plugin` does not support url like `../node_modules`\r\n\r\nwe know that `The Handler Property Is Very Flexible` but it should not good to include all unnecessary folder.look like there is also option by making more `s-project.json` file in sub folder but there is any document about how to use it\r\n\r\nwhat is solution to reduce lambda function zip size ? Thank You"},"comment":{"url":"https://api.github.com/repos/serverless/serverless/issues/comments/237796266","html_url":"https://github.com/serverless/serverless/issues/964#issuecomment-237796266","issue_url":"https://api.github.com/repos/serverless/serverless/issues/964","id":237796266,"user":{"login":"flomotlik","id":132653,"avatar_url":"https://avatars.githubusercontent.com/u/132653?v=3","gravatar_id":"","url":"https://api.github.com/users/flomotlik","html_url":"https://github.com/flomotlik","followers_url":"https://api.github.com/users/flomotlik/followers","following_url":"https://api.github.com/users/flomotlik/following{/other_user}","gists_url":"https://api.github.com/users/flomotlik/gists{/gist_id}","starred_url":"https://api.github.com/users/flomotlik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flomotlik/subscriptions","organizations_url":"https://api.github.com/users/flomotlik/orgs","repos_url":"https://api.github.com/users/flomotlik/repos","events_url":"https://api.github.com/users/flomotlik/events{/privacy}","received_events_url":"https://api.github.com/users/flomotlik/received_events","type":"User","site_admin":false},"created_at":"2016-08-05T08:57:05Z","updated_at":"2016-08-05T08:57:05Z","body":"You can see the include/exclude functionality of V1 here: https://github.com/serverless/serverless/blob/master/docs/understanding-serverless/serverless-yml.md"}}
{"actor":{"display_login":"flomotlik"}}