-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Implement subpath exports #73
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR Colin! You can lint & auto-fix via
I'm open to this change, but given the motivation is performance, I think I'd want it in a separate PR addressing & evaluating async/sync performance holistically. Do you mind separating it out? |
Done! Motivation is both performance and DX...trying to get flatMap and async to play nice was not fun lol |
This implements support for wildcards in
"exports"
.builds/package-exports.ts
ExportEntry
can now potentially be mapped to multipleSourcePath
objects. When an asterisk is detected in theoutputPath
, this usesglob
to find all src files that match against the wildcard path (it runs a glob search for everydistExtension
intryExtensions
).getExportEntries
, I just cleaned up theparseExportsMap
recursion logic a bit.parseExportsMap
. This method was accumulating a lot of parameters (it was up to four) so I merged them into a params object instead. I can flatten this out again if you prefer. The new interface I added is calledParseExportsContext
.fsExists
to be synchronous and useexistsSync
(which isn't deprecated, unlikeexists
). For a CLI tool like this it's usually faster to keep things synchronous anyway, since Promises are just adding overhead and additional ticks. I can change this back too if you prefer.I couldn't find a way to format the files according to a standard config, am I missing something?