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

fix: mains by format fallbacks #964

Merged
merged 3 commits into from Aug 11, 2022
Merged

Conversation

rschristian
Copy link
Collaborator

Fixes #963

Typo was from #950

We were missing tests for controlling the output filenames from package.json nearly entirely, both the common fields ("main", "module", etc.) and their alts ("cjs:main", "esmodule", etc.). This adds a test suite for both (though there's still a few untested fields, like nested "exports" and "syntax.esmodule" entry).

@changeset-bot
Copy link

changeset-bot bot commented May 19, 2022

🦋 Changeset detected

Latest commit: a624894

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
microbundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -0,0 +1,10 @@
{
"name": "custom-outputs",
"main": "dist/custom-outputs.js",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't actually test "main" correctly, as setting main creates a confusing mess of filenames (see #825 & #896).

"main": "dist/custom-outputs.cjsx.js" would make (say) the module output file path into dist/custom-outputs.cjsx.modulex.mjs. That is the "correct" output name at this time, but would be confusing as hell to debug as it doesn't match the package.json, so I've skipped it.

@rschristian rschristian merged commit e72377a into master Aug 11, 2022
@rschristian rschristian deleted the fix/mains-by-format-fallbacks branch August 11, 2022 17:34
@preact-bot preact-bot mentioned this pull request Aug 11, 2022
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.

"esmodule" key not respected in v15.0.0
2 participants