Skip to content

Commit 2ab01cf

Browse files
committed
SFE support when using package:individually
1 parent c9d910c commit 2ab01cf

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

lib/inject.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,20 @@ function moveModuleUp(source, target, module) {
6262
return fse
6363
.readFileAsync(source)
6464
.then(buffer => JSZip.loadAsync(buffer))
65-
.then(sourceZip => sourceZip.filter(file => file.startsWith(module + '/')))
65+
.then(sourceZip =>
66+
sourceZip.filter(
67+
file =>
68+
file.startsWith(module + '/') ||
69+
file.startsWith('serverless_sdk/') ||
70+
file.match(/s_.*\.py/) !== null
71+
)
72+
)
6673
.map(srcZipObj =>
6774
zipFile(
6875
targetZip,
69-
srcZipObj.name.replace(module + '/', ''),
76+
srcZipObj.name.startsWith(module + '/')
77+
? srcZipObj.name.replace(module + '/', '')
78+
: srcZipObj.name,
7079
srcZipObj.async('nodebuffer')
7180
)
7281
)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-python-requirements",
3-
"version": "5.0.0",
3+
"version": "5.0.1",
44
"engines": {
55
"node": ">=6.0"
66
},

0 commit comments

Comments
 (0)