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

Feature: Customize modern output file name using the "exports" field #783

Closed
rschristian opened this issue Jan 7, 2021 · 0 comments · Fixed by #784
Closed

Feature: Customize modern output file name using the "exports" field #783

rschristian opened this issue Jan 7, 2021 · 0 comments · Fixed by #784

Comments

@rschristian
Copy link
Collaborator

Currently, users are not able to configure the modern output file name by using the "exports" field. For example, say the following package.json was being used:

{
	"main": "./dist/index.js",
	"module": "./dist/index.example.js",
	"exports": "./dist/index.example-two.js",
}

Microbundle would return index.js, index.example.js, and index.modern.js. The fact that the user has it as index.example-two.js would be ignored.

This, at the moment, is only customizable using "esmodules", though I don't see why exports shouldn't work too.

I'm not sure how often such a thing is used but I ran across it whilst running some tests. I'll write up a quick PR here. So long as "exports" is a string I think we should be safe to just use that value?

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 a pull request may close this issue.

1 participant