This repository was archived by the owner on Oct 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -428,6 +428,18 @@ functions:
428428 vendor: ./hello-vendor # The option is also available at the function level
429429` ` `
430430
431+ # ## Copy dependencies instead of linking
432+
433+ Before final packaging, a link is created in .serverless folder for python dependencies.
434+ If it is not possible to create a symbolic link, dependencies can be copied instead of linked
435+ whith the foloowing option :
436+
437+ ` ` ` yaml
438+ custom:
439+ pythonRequirements:
440+ useFinalCopy: true
441+ ` ` `
442+
431443# # Manual invocations
432444
433445The `.requirements` and `requirements.zip`(if using zip support) files are left
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ class ServerlessPythonRequirements {
5858 pipCmdExtraArgs : [ ] ,
5959 noDeploy : [ ] ,
6060 vendor : '' ,
61+ useFinalCopy : false ,
6162 } ,
6263 ( this . serverless . service . custom &&
6364 this . serverless . service . custom . pythonRequirements ) ||
Original file line number Diff line number Diff line change @@ -782,7 +782,9 @@ async function installAllRequirements() {
782782 reqsInstalledAt != symlinkPath
783783 ) {
784784 // Windows can't symlink so we have to use junction on Windows
785- if ( process . platform == 'win32' ) {
785+ if ( this . serverless . service . custom . pythonRequirements . useFinalCopy ) {
786+ fse . copySync ( reqsInstalledAt , symlinkPath ) ;
787+ } else if ( process . platform == 'win32' ) {
786788 fse . symlink ( reqsInstalledAt , symlinkPath , 'junction' ) ;
787789 } else {
788790 fse . symlink ( reqsInstalledAt , symlinkPath ) ;
You can’t perform that action at this time.
0 commit comments