oddbird / css-toggles

CSS Toggles demo and polyfill
https://toggles.oddbird.net
BSD 3-Clause "New" or "Revised" License
58 stars 2 forks source link

Packaging #4

Closed jerivas closed 2 years ago

jerivas commented 2 years ago

We should determine an effective strategy to package and distribute the polyfill. Looking at https://github.com/GoogleChromeLabs/container-query-polyfill it looks like we can use esbuild to produce module and commonjs artifacts. Is that good enough? Are there better approaches?

jerivas commented 2 years ago

As of f0435e24ccbdec46363f8200d8828b3afa1a029c we now have a build step that produces esm and iife bundles inside a dist folder. Now we just need to actually publish the package to npm, would love to get guidance on the best way to do that, preferably in some automated way.

@mirisuzanne the demo site is now broken because index.html now refers to /dist/css-toggles.js, which doesn't exist unless you run yarn build. Could you add that to the Netlify config? Happy to do it myself if you grant me access

jgerigmeyer commented 2 years ago

@jerivas I added you to all our Netlify sites, so you should have access to fix this now.

Related: #12

jerivas commented 2 years ago

Thanks! Just updated the config and the demo site is back online

jerivas commented 2 years ago

We now have automated releases whenever we push to main (publishes to next) or stable (publishes to latest). Changelog is auto-generated and available at https://github.com/oddbird/css-toggles/releases.

This also allows people to use the polyfill via CDNs like unpkg.