1 import { basename, extname, isAbsolute, join, resolve } from 'path'
6 if (rootPath) return rootPath
10 if (basename(rootPath) === 'core-utils') rootPath = resolve(rootPath, '..')
11 if (basename(rootPath) === 'shared') rootPath = resolve(rootPath, '..')
12 if (basename(rootPath) === 'server') rootPath = resolve(rootPath, '..')
13 if (basename(rootPath) === 'dist') rootPath = resolve(rootPath, '..')
18 function buildPath (path: string) {
19 if (isAbsolute(path)) return path
21 return join(root(), path)
24 function getLowercaseExtension (filename: string) {
25 const ext = extname(filename) || ''
27 return ext.toLowerCase()