Skip to content

Commit 8365f8c

Browse files
committed
ignore some files
1 parent cc9eaab commit 8365f8c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/adapter/middleware.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ const copyHandlerDependenciesForNodeMiddleware = async (
111111
await handleFileOrDirectory(join(fileOrDir, fileInDir))
112112
}
113113
} else {
114+
// avoid unnecessary files
115+
if (fileOrDir.endsWith('.d.ts') || fileOrDir.endsWith('.js.map')) {
116+
return
117+
}
114118
const content = await readFile(fileOrDir, 'utf8')
115119

116120
parts.push(

src/adapter/static-assets.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export async function onBuildComplete(
2323
'_next',
2424
'data',
2525
buildID,
26-
`${distPathname === '/' ? 'index' : distPathname}.json`,
26+
// eslint-disable-next-line unicorn/no-nested-ternary
27+
`${distPathname === '/' ? 'index' : distPathname.endsWith('/') ? distPathname.slice(0, -1) : distPathname}.json`,
2728
)
2829
await mkdir(dirname(dataFilePath), { recursive: true })
2930
await writeFile(dataFilePath, '{}')

0 commit comments

Comments
 (0)