Skip to content

Commit 6f17c52

Browse files
committed
chore: unnecessary ensureDir when creating server handler
1 parent a6a0079 commit 6f17c52

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/helpers/functions.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { writeFile } from 'fs/promises'
22

33
import { nodeFileTrace } from '@vercel/nft'
4-
import { copy, emptyDir, ensureDir, readJson, writeJSON } from 'fs-extra/esm'
4+
import { copy, emptyDir, readJson, writeJSON } from 'fs-extra/esm'
55

66
import { BUILD_DIR, SERVER_HANDLER_DIR, SERVER_HANDLER_NAME, PLUGIN_DIR } from './constants.js'
77

@@ -13,16 +13,15 @@ const pkg = await readJson(`${PLUGIN_DIR}/package.json`)
1313
export const createServerHandler = async () => {
1414
// reset the handler directory
1515
await emptyDir(SERVER_HANDLER_DIR)
16-
await ensureDir(`${SERVER_HANDLER_DIR}/node_modules`)
1716

1817
// trace the handler dependencies
1918
const { fileList } = await nodeFileTrace(
2019
[`${PLUGIN_DIR}/dist/handlers/server.js`, `${PLUGIN_DIR}/dist/handlers/cache.cjs`],
2120
{ base: PLUGIN_DIR, ignore: ['package.json', 'node_modules/next/**'] },
2221
)
2322

23+
// copy the handler dependencies
2424
await Promise.all(
25-
// copy the handler dependencies
2625
[...fileList].map((path) => copy(`${PLUGIN_DIR}/${path}`, `${SERVER_HANDLER_DIR}/${path}`)),
2726
)
2827

0 commit comments

Comments
 (0)