Tuts / Examples for Hotwire + Asset pipeline + Skypack?

I explained what “download ESM from skypack” means here:

In the link above I’m using SortableJS so you’d open their cdn URL and grab the other URL inside. For example:

  1. Open https://cdn.skypack.dev/sortablejs@1.13.0?min
  2. Then grab the path and open the final URL: https://cdn.skypack.dev/-/sortablejs@v1.13.0-mei9zfSyMp6mF9rZklbl/dist=es2020,mode=imports,min/optimized/sortablejs.js
  3. Place the file above in the app/assets/javascripts/libraries and the stimulus help from your importmap will pickup the import correctly.

I hope this helps.

4 Likes