This repository was archived by the owner on Sep 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -55,15 +55,14 @@ module.exports = class IncludeDependencies {
5555 this . processFunction ( functionName ) ;
5656 }
5757
58- const filesNeedImporting = this . getIncludeRequires ( ) ;
59-
60- const importFiles = filesNeedImporting . map ( modulePath => glob . sync ( path . join ( modulePath , '**' ) , {
61- nodir : true ,
62- ignore : path . join ( modulePath , 'node_modules' , '**' ) ,
63- absolute : false
64- } ) ) . flat ( ) ;
65-
66- importFiles . forEach ( fileName => {
58+ const files = [ ...new Set ( this . getPatterns ( ) . filter ( pattern => ! pattern . startsWith ( '!' ) && ! pattern . includes ( 'node_modules' ) )
59+ . map ( modulePath => glob . sync ( path . join ( modulePath , '**' ) , {
60+ nodir : true ,
61+ ignore : path . join ( modulePath , 'node_modules' , '**' ) ,
62+ absolute : false
63+ } ) ) . flat ( ) ) ] ;
64+
65+ files . forEach ( fileName => {
6766 const dependencies = this . getDependencies ( fileName , service . package . patterns ) ;
6867 service . package . patterns = union ( service . package . patterns , dependencies ) ;
6968 } ) ;
@@ -83,9 +82,9 @@ module.exports = class IncludeDependencies {
8382 }
8483 }
8584
86- getIncludeRequires ( ) {
85+ getPatterns ( ) {
8786 const service = this . serverless . service ;
88- return ( service . package && service . package . includeRequires ) || { } ;
87+ return ( service . package && service . package . patterns ) || { } ;
8988 }
9089
9190 getPluginOptions ( ) {
You can’t perform that action at this time.
0 commit comments