chore(web-components): Normalize exports paths #32451
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previous Behavior
The default exports for components pointed to the
define.js
files. This is convenient when you want to import the side-effectfuldefine()
calls for the browser. However, importing specific exports from components has to be done at the top level.New Behavior
<component-name>.js
define()
calls can be imported at<component-name>/define.js
<component-name>/options.js
<component-name>/template.js
<component-name>/styles.js
<component-name>/definition.js
Reviewer Notes
This PR also changes the
sideEffects
array to use./dist/esm/**/define.js
instead of individual entries for everydefine.js
file.sideEffects
is a nonstandard feature mainly used by Webpack, so I'm not sure if this will work everywhere. Here's the documentation for that feature.