File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,20 @@ const normalizeSettings = (settings: Partial<Settings>, config: NormalizedCached
4444 const plugins = getPluginsToAutoInstall ( command , settings . plugins_from_config_file , settings . plugins_recommended )
4545 const recommendedPlugins = getRecommendPlugins ( plugins , config )
4646
47+ let functionsDir = config . build . functions || 'netlify/functions'
48+ const repositoryRoot = command . netlify . repositoryRoot
49+ if ( functionsDir && path . isAbsolute ( functionsDir ) && repositoryRoot ) {
50+ const relativePath = path . relative ( repositoryRoot , functionsDir )
51+ if ( relativePath && ! relativePath . startsWith ( '..' ) ) {
52+ functionsDir = relativePath
53+ }
54+ }
55+
4756 return {
4857 defaultBaseDir : settings . baseDirectory ?? command . project . relativeBaseDirectory ?? '' ,
4958 defaultBuildCmd : config . build . command || settings . buildCommand ,
5059 defaultBuildDir : settings . dist ,
51- defaultFunctionsDir : config . build . functions || 'netlify/functions' ,
60+ defaultFunctionsDir : functionsDir ,
5261 recommendedPlugins,
5362 }
5463}
You can’t perform that action at this time.
0 commit comments