Skip to content

Commit 59c2646

Browse files
committed
fix: until we found a way to run edge functions during dev, remove them
1 parent 31b44b9 commit 59c2646

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
const { rm } = require('fs/promises')
2+
const { join } = require('path')
3+
14
const ensureNoCompetingPlugin = require('./helpers/ensureNoCompetingPlugin')
25
const getAngularJson = require('./helpers/getAngularJson')
36
const getAngularRoot = require('./helpers/getAngularRoot')
@@ -7,6 +10,13 @@ const validateAngularVersion = require('./helpers/validateAngularVersion')
710
let isValidAngularProject = true
811

912
module.exports = {
13+
async onDev({ constants }) {
14+
// during local dev, the angular dev server will perform SSR,
15+
// and we won't have the server output to generate the edge function.
16+
// removing any edge function generated by a previous build ensures we don't try to use it.
17+
const edgeFunctionDir = join(constants.INTERNAL_EDGE_FUNCTIONS_SRC, 'angular-ssr')
18+
await rm(edgeFunctionDir, { recursive: true })
19+
},
1020
async onPreBuild({ netlifyConfig, utils }) {
1121
const siteRoot = getAngularRoot({ netlifyConfig })
1222
isValidAngularProject = await validateAngularVersion(siteRoot)

0 commit comments

Comments
 (0)