Skip to content

Commit aa29aad

Browse files
committed
use builtin functions
1 parent 21eda05 commit aa29aad

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/node/config.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,18 +176,6 @@ export function isAdditionalConfigFile(path: string) {
176176
return additionalConfigRE.test(path)
177177
}
178178

179-
/**
180-
* Make sure the path ends with a slash.
181-
* If path points to a file, remove the filename component.
182-
* @param path
183-
* @returns
184-
*/
185-
function dirname(path: string) {
186-
const segments = path.split('/')
187-
segments[segments.length - 1] = ''
188-
return segments.join('/')
189-
}
190-
191179
async function gatherAdditionalConfig(
192180
root: string,
193181
command: 'serve' | 'build',
@@ -208,7 +196,7 @@ async function gatherAdditionalConfig(
208196

209197
const exports = await Promise.all(
210198
candidates.map(async (file) => {
211-
const id = '/' + dirname(slash(file))
199+
const id = normalizePath(`/${path.dirname(file)}/`)
212200

213201
const configExports = await loadConfigFromFile(
214202
{ command, mode },

0 commit comments

Comments
 (0)