Skip to content

Commit ad51812

Browse files
committed
chore: copy shared ef files before writing next config
1 parent 3def6ab commit ad51812

File tree

1 file changed

+1
-2
lines changed
  • packages/runtime/src/helpers

1 file changed

+1
-2
lines changed

packages/runtime/src/helpers/edge.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export const writeEdgeFunctions = async (netlifyConfig: NetlifyConfig) => {
203203
const { publish } = netlifyConfig.build
204204
const nextConfigFile = await getRequiredServerFiles(publish)
205205
const nextConfig = nextConfigFile.config
206-
await ensureDir(join(edgeFunctionRoot, 'edge-shared'))
206+
await copy(getEdgeTemplatePath('../edge-shared'), join(edgeFunctionRoot, 'edge-shared'))
207207
await writeJSON(join(edgeFunctionRoot, 'edge-shared', 'nextConfig.json'), nextConfig)
208208

209209
if (!process.env.NEXT_DISABLE_EDGE_IMAGES) {
@@ -223,7 +223,6 @@ export const writeEdgeFunctions = async (netlifyConfig: NetlifyConfig) => {
223223
})
224224
}
225225
if (process.env.NEXT_DISABLE_NETLIFY_EDGE !== 'true' && process.env.NEXT_DISABLE_NETLIFY_EDGE !== '1') {
226-
await copy(getEdgeTemplatePath('../edge-shared'), join(edgeFunctionRoot, 'edge-shared'))
227226
const middlewareManifest = await loadMiddlewareManifest(netlifyConfig)
228227
if (!middlewareManifest) {
229228
console.error("Couldn't find the middleware manifest")

0 commit comments

Comments
 (0)