-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add named exports to build files #3644
Conversation
This makes sense, however can you rename the exports back to their single-word name? So "collapse" instead of "collapsePlugin"? I'll merge this if you do that. Thanks |
83398f1
to
78dc417
Compare
Removed |
78dc417
to
c0091b7
Compare
@@ -1,5 +1,5 @@ | |||
import morphPlugin, { morph } from '../src/index.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these are two separate exports and should remain that way.
But now I see that this would mean this plugin diverges from the rest of the named plugin exports.
Hmmmm.... the "morphPlugin" variable is actually the plugin, and "morph" is the morphing function, not the full plugin.
So this change would cause a breakage for other people consuming { morph }
It's not documented so I'm not sure how much of a breaking change it would be, but it at least will probably break something internally? or with Livewire?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just found at least one usage of this. Jest tests are using this export.
Are this tests still used? They are not running on CI, and currently are failing.
Like discussed on #3637, Node handles default export differently from other tools, causing the imported object to be wrapped in another object with a
default
key.This PR adds named export to all packages, allowing imports that work with both import interpretations.
For plugins the exported name has a
Plugin
suffix, since@alpinejs/morph
already has a export named onlymorph
.This solution is the recommendation from esbuild.