@@ -23,7 +23,7 @@ import {
2323import detectServerSettings , { getConfigWithPlugins } from '../../utils/detect-server-settings.js'
2424import { UNLINKED_SITE_MOCK_ID , getDotEnvVariables , getSiteInformation , injectEnvVariables } from '../../utils/dev.js'
2525import { getEnvelopeEnv } from '../../utils/env/index.js'
26- import { getFrameworksAPIPaths } from '../../utils/frameworks-api.js'
26+ import { getFrameworksAPIPaths , getFrameworksAPIConfig } from '../../utils/frameworks-api.js'
2727import { getInternalFunctionsDir } from '../../utils/functions/functions.js'
2828import { ensureNetlifyIgnore } from '../../utils/gitignore.js'
2929import openBrowser from '../../utils/open-browser.js'
@@ -34,7 +34,7 @@ import BaseCommand from '../base-command.js'
3434import { type DevConfig } from '../dev/types.js'
3535
3636export const serve = async ( options : OptionValues , command : BaseCommand ) => {
37- const { api, cachedConfig, config, repositoryRoot, site, siteInfo, state } = command . netlify
37+ const { api, cachedConfig, config, frameworksAPIPaths , repositoryRoot, site, siteInfo, state } = command . netlify
3838 config . dev = { ...config . dev }
3939 config . build = { ...config . build }
4040 const devConfig = {
@@ -80,8 +80,6 @@ export const serve = async (options: OptionValues, command: BaseCommand) => {
8080 packagePath : command . workspacePackage ,
8181 } )
8282
83- const frameworksAPIPaths = getFrameworksAPIPaths ( site . root , command . workspacePackage )
84-
8583 await frameworksAPIPaths . functions . ensureExists ( )
8684
8785 let settings : ServerSettings
@@ -119,6 +117,8 @@ export const serve = async (options: OptionValues, command: BaseCommand) => {
119117 env : { } ,
120118 } )
121119
120+ const mergedConfig = await getFrameworksAPIConfig ( config , frameworksAPIPaths . config . path )
121+
122122 // Now we generate a second Blobs context object, this time with edge access
123123 // for runtime access (i.e. from functions and edge functions).
124124 const runtimeBlobsContext = await getBlobsContextWithEdgeAccess ( blobsOptions )
@@ -128,7 +128,7 @@ export const serve = async (options: OptionValues, command: BaseCommand) => {
128128 const functionsRegistry = await startFunctionsServer ( {
129129 blobsContext : runtimeBlobsContext ,
130130 command,
131- config,
131+ config : mergedConfig ,
132132 debug : options . debug ,
133133 loadDistFunctions : true ,
134134 settings,
@@ -164,7 +164,7 @@ export const serve = async (options: OptionValues, command: BaseCommand) => {
164164 addonsUrls,
165165 blobsContext : runtimeBlobsContext ,
166166 command,
167- config,
167+ config : mergedConfig ,
168168 configPath : configPathOverride ,
169169 debug : options . debug ,
170170 disableEdgeFunctions : options . internalDisableEdgeFunctions ,
0 commit comments