@@ -53,12 +53,11 @@ const coreStep = async function ({
53
53
const distImportMapPath = join ( dirname ( internalSrcPath ) , IMPORT_MAP_FILENAME )
54
54
const srcPath = srcDirectory ? resolve ( buildDir , srcDirectory ) : undefined
55
55
const frameworksAPISrcPath = resolve ( buildDir , packagePath || '' , FRAMEWORKS_API_EDGE_FUNCTIONS_ENDPOINT )
56
-
57
- let generatedFunctionsPath = internalSrcPath
56
+ const generatedFunctionPaths = [ internalSrcPath ]
58
57
59
58
if ( featureFlags . netlify_build_frameworks_api ) {
60
59
if ( await pathExists ( frameworksAPISrcPath ) ) {
61
- generatedFunctionsPath = frameworksAPISrcPath
60
+ generatedFunctionPaths . unshift ( frameworksAPISrcPath )
62
61
}
63
62
64
63
const frameworkImportMap = resolve (
@@ -73,7 +72,7 @@ const coreStep = async function ({
73
72
}
74
73
}
75
74
76
- const sourcePaths = [ generatedFunctionsPath , srcPath ] . filter ( Boolean ) as string [ ]
75
+ const sourcePaths = [ ... generatedFunctionPaths , srcPath ] . filter ( Boolean ) as string [ ]
77
76
78
77
logFunctions ( { frameworksAPISrcPath, internalSrcDirectory, internalSrcPath, logs, srcDirectory, srcPath } )
79
78
@@ -89,7 +88,7 @@ const coreStep = async function ({
89
88
// no-op
90
89
}
91
90
92
- let vendorDirectory
91
+ let vendorDirectory : string | undefined
93
92
94
93
// If we're building locally, set a vendor directory in `internalSrcPath`.
95
94
// This makes Edge Bundler keep the vendor files around after the build,
@@ -115,7 +114,7 @@ const coreStep = async function ({
115
114
importMapPaths,
116
115
userLogger : ( ...args ) => log ( logs , reduceLogLines ( args ) ) ,
117
116
systemLogger : systemLog ,
118
- internalSrcFolder : generatedFunctionsPath ,
117
+ internalSrcFolder : generatedFunctionPaths ,
119
118
bootstrapURL : edgeFunctionsBootstrapURL ,
120
119
vendorDirectory,
121
120
} )
0 commit comments