diff --git a/apps/oxlint/src-js/plugins/load.ts b/apps/oxlint/src-js/plugins/load.ts index e3045436ad44a..f097323248323 100644 --- a/apps/oxlint/src-js/plugins/load.ts +++ b/apps/oxlint/src-js/plugins/load.ts @@ -1,3 +1,5 @@ +import { pathToFileURL } from 'node:url'; + import { Context } from './context.js'; import { getErrorMessage } from './utils.js'; @@ -100,7 +102,7 @@ async function loadPluginImpl(path: string): Promise { throw new Error('This plugin has already been registered. This is a bug in Oxlint. Please report it.'); } - const { default: plugin } = (await import(path)) as { default: Plugin }; + const { default: plugin } = (await import(pathToFileURL(path).href)) as { default: Plugin }; registeredPluginPaths.add(path);