New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial attempt for ESM support #11
Conversation
@@ -72,8 +67,8 @@ if (electron && nvm && !fs.existsSync(globals)) { | |||
* @param {LoadPluginOptions} [options] | |||
* @returns {any} | |||
*/ | |||
function loadPlugin(name, options) { | |||
return require(resolvePlugin(name, options) || name) | |||
export default function loadPlugin(name, options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests rely on this being the default export. I personally prefer a named export, especially for packages that export multiple members.
|
||
module.exports = loadPlugin | ||
loadPlugin.resolve = resolvePlugin | ||
import {read as readNpmConfig} from 'libnpmconfig' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libnpmconfig
relies on figgy-pudding
, which is marked for deprecation. I think it’s better to look at an alternative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also be that libnpmconfig
will swap that out for another project?
Leaving the node algorithm here: https://nodejs.org/dist/latest-v14.x/docs/api/esm.html#esm_resolver_algorithm_specification EDIT and: https://github.com/daKmoR/import-meta-resolve/blob/master/src/importMetaResolve.js |
I’m now the owner of |
it works! |
No description provided.