Skip to content

fix: mains by format fallbacks - #964

Merged
rschristian merged 3 commits into
masterfrom
fix/mains-by-format-fallbacks
Aug 11, 2022
Merged

fix: mains by format fallbacks#964
rschristian merged 3 commits into
masterfrom
fix/mains-by-format-fallbacks

Conversation

@rschristian

Copy link
Copy Markdown
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

changeset-bot Bot commented May 19, 2022

Copy link
Copy Markdown

🦋 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
Copy Markdown
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

2 participants