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

Default exports not exported from lwc sub-packages #3605

Closed
nolanlawson opened this issue Jul 5, 2023 · 2 comments
Closed

Default exports not exported from lwc sub-packages #3605

nolanlawson opened this issue Jul 5, 2023 · 2 comments
Labels

Comments

@nolanlawson
Copy link
Contributor

nolanlawson commented Jul 5, 2023

(Follow-up to #3594 )

import plugin from '@lwc/rollup-plugin' // works
import plugin from 'lwc/rollup-plugin'  // throws Error due to no default export

I guess export * from 'foo' doesn't export default. We should add default exports to those packages that have htem.

@git2gus
Copy link

git2gus bot commented Jul 5, 2023

This issue has been linked to a new work item: W-13710298

@nolanlawson
Copy link
Contributor Author

Well, there is a workaround:

import * as mod from 'lwc/rollup-plugin'
console.log(mod.default)

Also due to ESM-CJS interop, there is a weird effect anyway even if we do export the default, which is that you get

{ default: theThing }

...instead of just theThing.

Maybe we should just have a breaking change where we get rid of all our default exports. They always have weird compat issues anyway (e.g. with Jest).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant