Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

remcohaszing
Copy link
Contributor

No description provided.

@@ -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) {
Copy link
Contributor Author

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'
Copy link
Contributor Author

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.

Copy link
Owner

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?

@wooorm
Copy link
Owner

wooorm commented Apr 3, 2021

@wooorm
Copy link
Owner

wooorm commented May 12, 2021

I’m now the owner of import-meta-resolve, and will try to port how Node does that resolving. Probably tons of tests though, so that’ll take some time

wooorm added a commit that referenced this pull request May 14, 2021
Related to GH-11.

Co-authored-by: Remco Haszing <remcohaszing@gmail.com>
@wooorm wooorm closed this in #12 May 14, 2021
@wooorm
Copy link
Owner

wooorm commented May 14, 2021

it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants