Skip to content

Commit c8388f1

Browse files
committed
fix(watcher): resolve relative paths without leading dot
1 parent cd9f66a commit c8388f1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/_utils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { networkInterfaces } from "node:os";
33
import { relative, resolve } from "node:path";
44
import { colors } from "consola/utils";
55
import { fileURLToPath } from "mlly";
6+
import { isAbsolute } from "pathe";
67
import type { Certificate, HTTPSOptions } from "./types";
78

89
export async function resolveCert(
@@ -79,7 +80,11 @@ export async function createImporter(input: string, _cwd?: string) {
7980
interopDefault: true,
8081
});
8182

82-
const entry = _jitiRequire.resolve(input);
83+
if (!isAbsolute(input) && !input.startsWith(".")) {
84+
input = `./${input}`;
85+
}
86+
87+
const entry = _jitiRequire.resolve(resolve(cwd, input));
8388

8489
const _import = () => {
8590
const r = _jitiRequire(input);

0 commit comments

Comments
 (0)