Skip to content

Commit

Permalink
fix(watcher): resolve relative paths without leading dot
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 2, 2023
1 parent cd9f66a commit c8388f1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { networkInterfaces } from "node:os";
import { relative, resolve } from "node:path";
import { colors } from "consola/utils";
import { fileURLToPath } from "mlly";
import { isAbsolute } from "pathe";
import type { Certificate, HTTPSOptions } from "./types";

export async function resolveCert(
Expand Down Expand Up @@ -79,7 +80,11 @@ export async function createImporter(input: string, _cwd?: string) {
interopDefault: true,
});

const entry = _jitiRequire.resolve(input);
if (!isAbsolute(input) && !input.startsWith(".")) {
input = `./${input}`;
}

const entry = _jitiRequire.resolve(resolve(cwd, input));

const _import = () => {
const r = _jitiRequire(input);
Expand Down

0 comments on commit c8388f1

Please sign in to comment.