-
-
Notifications
You must be signed in to change notification settings - Fork 191
Closed
Description
In lieu of this module supporting exports out of the box, it would be awesome if consumers could use its existing capabilities (packageFilter, pathFilter etc.) to implement support for exports on the consumer side.
I have experimented a bit with this, and from what I can tell there are 2 issues:
resolveaddsindexif a directory is specified (). This can potentially cause issues in the caseLine 192 in f1b5184
return loadAsFileSync(path.join(x, '/index')); indexis not specified by the user as changing it to.(which is what a directory means inexports) is not necessarily a safe operation. Not sure how to mitigate this in a way that's backwards compatible.- I tried to use
pathFilterwhich works great forrequire('some-module/thing'), but it doesn't work forrequire('./some-thing')from within a module. Relative imports within a module isn't restricted byexports, butpathFiltercannot know if the resolution request is for a relative file or not. A solution here is maybe to include a flag saying if it's relative within the package or not?
antongolub and chentsulin
Metadata
Metadata
Assignees
Labels
No labels