What about `cdn` entry?
VitorLuizC opened this issue · comments
Sometimes I see cdn
entry, does it works for unpkg
and jsdelivr
? Is there some standard about it?
I hear first time about it. Do you have example of npm package?
https://www.jsdelivr.com/features#publishing-packages
For packages hosted on npm, we support setting a "default" file for each package. This file is displayed at the top of directory listings on our website and available under shorter URL on the CDN. The default file can be configured by setting one of the following fields in package.json (ordered by priority):
jsdelivr
browser
main
If you omit the file path (i.e. use a "bare" URL), unpkg will serve the file specified by the unpkg field in package.json, or fall back to main.
https://github.com/cdnjs/cdnjs
no data
There's other packages using it
- https://github.com/ElementUI/region-picker/blob/ab7f356f15427db44f79b84ef0d626e3401dcd57/package.json#L7
- https://github.com/praveenpuglia/vuetify-daterange-picker/blob/a9f81755c0abc4b35771e3c6aca47a0a749ecd97/package.json#L9
- https://github.com/gergely-nagy/react-empty-state/blob/73017f29aedf16bcfd6199cc632306a364a9444a/package.json#L10
- https://github.com/reactstrap/reactstrap/blob/abbac56c18ba4aeb7552fff7a23976bee28d99c0/package.json#L10
- https://github.com/tunnckoCore/gitcommit/blob/b26f71d90ab68e355a8914002edd935520a25f18/package.json#L64
- https://github.com/dimensi/vue-root-modals/blob/43d8352c229996663f0eff4a08754cc8e0cb7341/package.json#L7
There's a issue on bili
to generate it automatically with unpkg
and other package entries. egoist/bili#34
And seems to be used a lot by EGOIST
https://github.com/search?q=cdn+filename%3Apackage.json+user%3Aegoist&type=Code
The only thing I can find is this bower/bower#19, but this is something else
I really don't known, but I'm guessing this is for some CDN service on China.
@egoist, can you tell us about this entry?
We support(ed) cdn
at jsDelivr, in addition to jsdelivr
, browser
, and main
fields. Initially we had this documented on our website and tried to make an agreement with unpkg to promote it together as a replacement for service-specific fields. Unpkg didn't agree so we went back to recommending a jsdelivr
field. cdn
still works though, for packages that use it.
@MartinKolarik thanks for insight