feat: leverage "exports" field in package.json #776
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.
Description
CDNs like https://jspm.org/ generally rely on statistical analysis to decide what parts of a package to deploy to their servers. This works best when there is a large number (which we don't have) of uniform usages, but even with this, things like
sp-*.js
being very similar tosp-*
across various build settings can lead to only some of the artifacts of a package being served. This PR expands ourpackage.json
files to support theexports
field so that we can tell these sorts of tools what files we export explicitly so as to overcome our early low usage rate and any compatibility issues that might arise later of users leveraging file extension or not.Motivation and Context
Easier end-user implementation.
How Has This Been Tested?
Previously:
https://jspm.dev/npm:@spectrum-web-components/icon@0.4/lib/spectrum-icon-checkmark-medium.css.js
Now (canary release):
https://jspm.dev/npm:@spectrum-web-components/icon@0.4.9-alpha.38/src/spectrum-icon-checkmark-medium.css.js
Types of changes
Checklist: