Support package.json#exports for specifying the default file.
See original GitHub issueWith Node.js supporting ES Modules there’s a new field in package.json called exports
. This field will override the main
field for ES Modules wanting to specify their “default” file. Currently jsDelivr supports jsdelivr
, browser
, or main
field in package.json
.
I’d suggest looking at supporting exports.default
and other related fields as well:
The “exports” field provides an alternative to “main” where the package main entry point can be defined
If both “exports” and “main” are defined, the “exports” field takes precedence over “main”.
With this new standard I imagine we’ll see more packages using exports.browser
and dropping browser
.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Modules: Packages | Node.js v19.3.0 Documentation
In a package's package.json file, two fields can define entry points for a package: "main" and "exports" . Both fields apply to both...
Read more >Package exports - webpack
The exports field in the package.json of a package allows to declare ... It replaces the default implementation that returns main field resp....
Read more >Node.JS (New) Package.json Exports Field | by Thomas Juster
The exports field (or “export map”) provides a way to expose your package modules for different environments and JavaScript flavors WHILE ...
Read more >package.json - npm Docs
It's assumed that it's js, since you're writing a package.json file, and you can specify the engine using the "engines" field. (See below.) ......
Read more >Package JSON Demystified - The 'Exports' Keyword - YouTube
In this Javascript tutorial on NPM Package. JSON we look at the ' EXPORTS ' keyword and how it helps us expose and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@SukkaW I got confused with a different term.
This is now fully supported in esm mode: https://github.com/jsdelivr/jsdelivr/issues/18263#issuecomment-989898481 We’re considering adding this as an alternative main field in the regular mode.