fix: honour package.pattern over internally set exclusion list #339
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey,
This PR enables the
package.pattern
to behave such that the user has the final say over what files are packaged.Currently a list of predefined files are always excluded from the final zip, which is not great from a flexibility point of view #315
serverless-esbuild/src/pack.ts
Line 38 in a233a1a
Further more currently the files returned from the pattern glob are added to an include list...
serverless-esbuild/src/pack.ts
Line 171 in a233a1a
... so although I may have used a glob like
!**/*.md
, those files will still be included into the final zip as thefilterFilesForZipPackage
will return true for any file that does not meet an exclusion criteria.Taking the view that what is defined in both
package.pattern
andfunction.pattern
as what files the user wants then we can remove files as needed.Let me know what you think :)
Considerations:
globby
has been removed.excludedFilesDefault
.