Repository navigation
Use Globs to Exclude Files - #2194
Conversation
|
Ready for review 🚀 |
|
Awesome! Please merge this! |
There was a problem hiding this comment.
Happy to see this line gone, I timed it and it was taking about 400ms just to test every file in node_modules. Hopefully globe isn't as slow.
|
Love this change. It will make deployment much faster, especially for people who exclude most of the root directories in their project, like if you have an |
pmuens
left a comment
There was a problem hiding this comment.
@jonsharratt Thank you very much for this really great addition!
Tested it today and it works great! Way better than the old approach.
Could you look through the codebase and remove all those include references? There are e.g. some in the docs and some in the serverless.yml template files.
Thanks in advance and good job! 👍
There was a problem hiding this comment.
Could you change the file extension to .yml as this is the one which is used throughout the whole docs. Thanks!
There was a problem hiding this comment.
@flomotlik do we even need this documentation as everything is moved in the docs directory? Feels like this a legacy doc which should be removed.
There was a problem hiding this comment.
Let me know if you want me to delete this file, in the mean time I have reworded as per your feedback 👯
|
😂 Awesome! Thank you very much @jonsharratt 💯 👍 There's just one other location where I think we might can get rid of the EDIT: Just found another minor one in |
|
Great spot! 👍 Ready for another review 🚀 |
|
@jonsharratt thanks for updating the PR and removing the final Great overall enhancement. Thanks for that 💃 🎉 |
|
This was an awesome change, but I think removing the |
|
Also, not following symlinks breaks packages installed with "npm link" |
|
@demetriusnunes you can use the negate symbol |
|
I tried that, doesn't work. I think negation is deprecated. |
| ignore: exclude, | ||
| dot: true, | ||
| silent: true, | ||
| }); |
There was a problem hiding this comment.
please include: follow: true, here
There was a problem hiding this comment.
It might actually be better to bring back the include option as you suggested and do:
glob.sync(include && include.length ? include || '**', {
cwd: servicePath,
ignore: exclude,
dot: true,
silent: true,
follow: true,
});
There was a problem hiding this comment.
I will take a look at this and amend accordingly if we wish to have the include option back, just drop a note on here to confirm and I will look to implement :)
|
Hey guys thank you for the valuable feedback! Could we open up a separate issue and a separate PR for that so that's it's easier to keep track? Thanks in advance! |
|
A glob on files in the current directory doesn't work The I have to do this instead which doesn't scale well to many files. It would be nice if Alternatively, exclude everything and force people to explicitly |
|
I dont think this change is available in |
|
Thanks for getting back! @jonsharratt opened up a PR which replaces the glob package. It will also introduce the possibility to include files again (which was previously removed) |
|
Hi! The include/ options was totally worth it. I used it to include shared libs and when packaging individually, i used it to include only the function i wanted. It was really easy to understand also. Serverless would exclude all, and then include all. With globs, I haven't tested it out but this is a new concept for me. I have to know globs now. :( |
|
@demetriusnunes the |
|
It's not clear what "include" was replaced with. It looks to have been stripped from the code but the residual documentation seems to still say it works. Am I understanding correctly that by default everything in the servicePath (the root service directory?) is included by default and only exclusions are excluded? Consequently, If we wanted to include files from different locations we'd need to copy them to the servicePath? |
|
Hey guys! Just a quick update on this: We brought back |

What did you implement:
_Implementing Issue:_ #2071
How did you implement it:
excludeHow can we verify it:
Add folder src to a project then use example config to verify they are not included. Other glob patterns can be tested.
Example config:
Todos: