excludeDevDependencies is not working when package points to parent directory
See original GitHub issueAre you certain it’s a bug?
- Yes, it looks like a bug
Is the issue caused by a plugin?
- It is not a plugin issue
Are you using the latest version?
- Yes, I’m using the latest version
Is there an existing issue for this?
- I have searched existing issues, it hasn’t been reported yet
Issue description
Serverless version: ^2.71.0
I decided to move my serverless.yml files into separated folder, and inside it point to the root folder:
|*root*
|-/infrastructure
|---serverless.yml
|-/src
|----*all code*
I can point serverless to include code from parent dir by using either include
or pattern
options in package
section.
However, in this case all node_modules gets included, even dev deps, even if you provide excludeDevDependencies: true
in package section.
So I can either include all dependencies, or exclude entire node_modules, nothing more (obviously, I can manually exclude some node modules, but this would be hell).
Service configuration (serverless.yml) content
service: service-name
package:
individually: true
excludeDevDependencies: true
include:
- "../../../**/*"
exclude:
- "../../../tests/**"
- "../../../infrastructure/**"
functions:
processUpdate:
name: function-name
handler: ./src/lambdas/processUpdate.handler
Command name and used flags
serverless deploy
Command output
Output is normal deployment output, with huge s3 .zip file.
Also, i'm on Windows 10, and inclusion of all node_modules sometimes fails into "EMFILE: too many open files"
Environment information
Framework Core: 2.71.0 (local)
Plugin: 5.5.3
SDK: 4.3.0
Components: 3.18.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
serverless framework - How to use excludeDevDependencies?
The problem is excludeDevDependencies only works fine when I comment the exclude - node_modules/** . It will generate .serverless directory and ...
Read more >Serverless Jetpack - Serverless Framework: Plugins
So how do we fix the problem? A first starting point is to generate a full report of the packaging step. Instead of...
Read more >rollup.js
When this file contains imports, Rollup will try to resolve them relative to the current working directory. When using a config file, Rollup...
Read more >Add ability to optionally ignore dev dependencies in NPM ...
Problem to solve When running Dependency Scanning on Node. ... For instance, in a project having the following package.json dependency file, ...
Read more >window-pain - npm Package Health Analysis - Snyk
In the past month we didn't find any pull request activity or change in issues status has been detected for the GitHub repository....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello @vssenko - thanks a lot for reporting. At the moment, exclusion of dependencies is always run against the
node_modules
placed in service directory, which in your case would be inside theinfrastructure
folder. I will bring this topic up during the internal meeting and will report back.Thank you all for being so responsive! I hope this new feature will be deployed soon!