-// ---------------------------------------------------------------------------
-
-let rootPath: string
-
-function root () {
- if (rootPath) return rootPath
-
- rootPath = __dirname
-
- if (basename(rootPath) === 'helpers') rootPath = resolve(rootPath, '..')
- if (basename(rootPath) === 'server') rootPath = resolve(rootPath, '..')
- if (basename(rootPath) === 'dist') rootPath = resolve(rootPath, '..')
-
- return rootPath
-}
-
-function buildPath (path: string) {
- if (isAbsolute(path)) return path
-
- return join(root(), path)