diff --git a/lib/plugin/factory.js b/lib/plugin/factory.js index 32a5c708..96912a99 100644 --- a/lib/plugin/factory.js +++ b/lib/plugin/factory.js @@ -1,3 +1,4 @@ +import url from 'url'; import path from 'path'; import { createRequire } from 'module'; import _ from 'lodash'; @@ -32,7 +33,7 @@ const load = async pluginName => { } catch (err) { // In some cases or tests we might need to support legacy `require.resolve` const require = createRequire(process.cwd()); - const module = await import(require.resolve(pluginName, { paths: [process.cwd()] })); + const module = await import(url.pathToFileURL(require.resolve(pluginName, { paths: [process.cwd()] }))); plugin = module.default; } }