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 @@ -416,6 +416,18 @@ functions:
416416 vendor: ./hello-vendor # The option is also available at the function level
417417` ` `
418418
419+ # ## Copy dependencies instead of linking
420+
421+ Before final packaging, a link is created in .serverless folder for python dependencies.
422+ If it is not possible to create a symbolic link, dependencies can be copied instead of linked
423+ whith the foloowing option :
424+
425+ ` ` ` yaml
426+ custom:
427+ pythonRequirements:
428+ useFinalCopy: true
429+ ` ` `
430+
419431# # Manual invocations
420432
421433The `.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 @@ -778,7 +778,9 @@ async function installAllRequirements() {
778778 reqsInstalledAt != symlinkPath
779779 ) {
780780 // Windows can't symlink so we have to use junction on Windows
781- if ( process . platform == 'win32' ) {
781+ if ( this . serverless . service . custom . pythonRequirements . useFinalCopy ) {
782+ fse . copySync ( reqsInstalledAt , symlinkPath ) ;
783+ } else if ( process . platform == 'win32' ) {
782784 fse . symlink ( reqsInstalledAt , symlinkPath , 'junction' ) ;
783785 } else {
784786 fse . symlink ( reqsInstalledAt , symlinkPath ) ;
You can’t perform that action at this time.
0 commit comments