File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change
1
+ const { rm } = require ( 'fs/promises' )
2
+ const { join } = require ( 'path' )
3
+
1
4
const ensureNoCompetingPlugin = require ( './helpers/ensureNoCompetingPlugin' )
2
5
const getAngularJson = require ( './helpers/getAngularJson' )
3
6
const getAngularRoot = require ( './helpers/getAngularRoot' )
@@ -7,6 +10,13 @@ const validateAngularVersion = require('./helpers/validateAngularVersion')
7
10
let isValidAngularProject = true
8
11
9
12
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
+ } ,
10
20
async onPreBuild ( { netlifyConfig, utils } ) {
11
21
const siteRoot = getAngularRoot ( { netlifyConfig } )
12
22
isValidAngularProject = await validateAngularVersion ( siteRoot )
You can’t perform that action at this time.
0 commit comments