diff --git a/lib/src/lifecycle/Application.ts b/lib/src/lifecycle/Application.ts index af5199d..1da7e66 100644 --- a/lib/src/lifecycle/Application.ts +++ b/lib/src/lifecycle/Application.ts @@ -132,7 +132,17 @@ export default class Application { * @return string */ path(...parts: string[]) { - return path.resolve(this.root, ...parts) + let root = this.root + if ( root.startsWith('file://') ) { + root = root.slice(7) + } + + const resolved = path.resolve(root, ...parts) + if ( resolved.startsWith('/') ) { + return `file://${resolved}` + } else { + return resolved + } } /** @@ -141,6 +151,16 @@ export default class Application { * @return string */ app_path(...parts: string[]) { - return path.resolve(this.app_root, ...parts) + let app_root = this.app_root + if ( app_root.startsWith('file://') ) { + app_root = app_root.slice(7) + } + + const resolved = path.resolve(app_root, ...parts) + if ( resolved.startsWith('/') ) { + return `file://${resolved}` + } else { + return resolved + } } }