From aa29aada4da705947b7029779eb1bd865ef0d738 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Mon, 14 Apr 2025 00:38:59 +0530 Subject: [PATCH] use builtin functions --- src/node/config.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/node/config.ts b/src/node/config.ts index 503964ff..5d751034 100644 --- a/src/node/config.ts +++ b/src/node/config.ts @@ -176,18 +176,6 @@ export function isAdditionalConfigFile(path: string) { return additionalConfigRE.test(path) } -/** - * Make sure the path ends with a slash. - * If path points to a file, remove the filename component. - * @param path - * @returns - */ -function dirname(path: string) { - const segments = path.split('/') - segments[segments.length - 1] = '' - return segments.join('/') -} - async function gatherAdditionalConfig( root: string, command: 'serve' | 'build', @@ -208,7 +196,7 @@ async function gatherAdditionalConfig( const exports = await Promise.all( candidates.map(async (file) => { - const id = '/' + dirname(slash(file)) + const id = normalizePath(`/${path.dirname(file)}/`) const configExports = await loadConfigFromFile( { command, mode },