@@ -3,10 +3,10 @@ import { join, relative } from 'path'
3
3
import type { NetlifyPlugin , NetlifyPluginOptions } from '@netlify/build'
4
4
import { bold , redBright } from 'chalk'
5
5
import destr from 'destr'
6
- import { existsSync , readFileSync , remove } from 'fs-extra'
6
+ import { existsSync , readFileSync } from 'fs-extra'
7
7
import { outdent } from 'outdent'
8
8
9
- import { HANDLER_FUNCTION_NAME , ODB_FUNCTION_NAME , HIDDEN_PATHS } from './constants'
9
+ import { HANDLER_FUNCTION_NAME , ODB_FUNCTION_NAME } from './constants'
10
10
import { restoreCache , saveCache } from './helpers/cache'
11
11
import {
12
12
getNextConfig ,
@@ -17,7 +17,7 @@ import {
17
17
} from './helpers/config'
18
18
import { onPreDev } from './helpers/dev'
19
19
import { writeEdgeFunctions , loadMiddlewareManifest , cleanupEdgeFunctions } from './helpers/edge'
20
- import { moveStaticPages , movePublicFiles , patchNextFiles } from './helpers/files'
20
+ import { moveStaticPages , movePublicFiles , patchNextFiles , removeMetadataFiles } from './helpers/files'
21
21
import { splitApiRoutes } from './helpers/flags'
22
22
import {
23
23
generateFunctions ,
@@ -254,12 +254,7 @@ const plugin: NetlifyPlugin = {
254
254
warnForProblematicUserRewrites ( { basePath, redirects } )
255
255
warnForRootRedirects ( { appDir } )
256
256
await warnOnApiRoutes ( { FUNCTIONS_DIST } )
257
-
258
- for ( const HIDDEN_PATH of HIDDEN_PATHS ) {
259
- const pathToDelete = join ( publish , HIDDEN_PATH )
260
- console . log ( { pathToDelete } )
261
- await remove ( pathToDelete )
262
- }
257
+ await removeMetadataFiles ( publish )
263
258
264
259
if ( experimental ?. appDir ) {
265
260
console . log (
0 commit comments