CdnTabs
CdnTabs generates CDN URLs and HTML tags for CSS and JavaScript files in an npm package. It displays jsDelivr and unpkg tabs by default.
Basic usage
The component generates a <link rel="stylesheet"> tag for each CSS file and a <script src> tag for each JavaScript file. File paths are relative to the package root.
Choose CDNs
Use cdns to select built-in CDNs and set their order:
Components that use only built-in providers share the cdn tab group.
Add a custom CDN
Use additionalTabs to append custom providers after the built-in tabs:
Use a unique name for each provider. It also serves as the tab label if you omit label. Use cdns={[]} to show only custom providers.
getUrl receives the URL-encoded package specifier and file path, with @ and / preserved. Components with custom providers synchronize their selected tab only when they use the same provider names in the same order.