File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ declare namespace Serverless {
36
36
interface Package {
37
37
include : string [ ]
38
38
exclude : string [ ]
39
+ patterns : string [ ]
39
40
artifact ?: string
40
41
individually ?: boolean
41
42
}
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ export class TypeScriptPlugin {
103
103
fn . package = fn . package || {
104
104
exclude : [ ] ,
105
105
include : [ ] ,
106
+ patterns : [ ]
106
107
}
107
108
108
109
// Add plugin to excluded packages or an empty array if exclude is undefined
@@ -157,13 +158,14 @@ export class TypeScriptPlugin {
157
158
return emitedFiles
158
159
}
159
160
160
- /** Link or copy extras such as node_modules or package.include definitions */
161
+ /** Link or copy extras such as node_modules or package.patterns definitions */
161
162
async copyExtras ( ) {
162
163
const { service } = this . serverless
163
164
165
+ const patterns = [ ...( service . package . include || [ ] ) , ...( service . package . patterns || [ ] ) ]
164
166
// include any "extras" from the "include" section
165
- if ( service . package . include && service . package . include . length > 0 ) {
166
- const files = await globby ( service . package . include )
167
+ if ( patterns . length > 0 ) {
168
+ const files = await globby ( patterns )
167
169
168
170
for ( const filename of files ) {
169
171
const destFileName = path . resolve ( path . join ( BUILD_FOLDER , filename ) )
Original file line number Diff line number Diff line change @@ -6,21 +6,24 @@ const functions: { [key: string]: Serverless.Function } = {
6
6
handler : 'tests/assets/hello.handler' ,
7
7
package : {
8
8
include : [ ] ,
9
- exclude : [ ]
9
+ exclude : [ ] ,
10
+ patterns : [ ]
10
11
}
11
12
} ,
12
13
world : {
13
14
handler : 'tests/assets/world.handler' ,
14
15
package : {
15
16
include : [ ] ,
16
- exclude : [ ]
17
+ exclude : [ ] ,
18
+ patterns : [ ]
17
19
}
18
20
} ,
19
21
js : {
20
22
handler : 'tests/assets/jsfile.create' ,
21
23
package : {
22
24
include : [ ] ,
23
- exclude : [ ]
25
+ exclude : [ ] ,
26
+ patterns : [ ]
24
27
}
25
28
} ,
26
29
}
You can’t perform that action at this time.
0 commit comments