Skip to content

Commit

Permalink
pathToFileUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Jul 31, 2022
1 parent 5ddbbf6 commit 04f67f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/utils/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as FS from "fs";
import * as Path from "path";
import { isAbsolute } from "path";
import { pathToFileURL } from "url";

import type { Application } from "../application";
import type { Logger } from "./loggers";
Expand All @@ -23,7 +24,7 @@ export async function loadPlugins(
// On Windows, we need to ensure this path is a file path.
// Or we'll get ERR_UNSUPPORTED_ESM_URL_SCHEME
const esmPath = isAbsolute(plugin)
? `file:///${plugin}`
? pathToFileURL(plugin).toString()
: plugin;
instance = await import(esmPath);
} else {
Expand Down

0 comments on commit 04f67f0

Please sign in to comment.