Cherry-picking components from the CDN - how to do it so it works? #748
-
Google Pagespeed Insights complained about some (large) JS chunks being loaded - so I gave the «cherry-picking» a shot, as described in the Installation.
Can't get it to work, though: Using the resource picker directly on jsDelivr gave me the following * (as I have selected these components' js only): <script type="module" src="https://cdn.jsdelivr.net/combine/npm/@shoelace-style/[email protected]/dist/components/tooltip/tooltip.min.js,npm/@shoelace-style/[email protected]/dist/components/icon/icon.min.js,npm/@shoelace-style/[email protected]/dist/components/button/button.min.js,npm/@shoelace-style/[email protected]/dist/components/button-group/button-group.min.js"></script> * note: i manually added But adding this to the
What am I missing? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I just found that it works to include each component individually from jsDelivr: <script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/[email protected]/dist/components/tooltip/tooltip.min.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/[email protected]/dist/components/icon/icon.min.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/[email protected]/dist/components/button/button.min.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/[email protected]/dist/components/button-group/button-group.min.js"></script> |
Beta Was this translation helpful? Give feedback.
-
For future reference, avoid using magic CDN links and stick with the copy/paste ones that are available from each component's page. e.g. https://shoelace.style/components/button?id=importing |
Beta Was this translation helpful? Give feedback.
I just found that it works to include each component individually from jsDelivr: