Ladda icon indicating copy to clipboard operation
Ladda copied to clipboard

Add bundling hints to the README?

Open cube-dan opened this issue 4 years ago • 0 comments

Greets team Ladda. It's mentioned in the README.md that it’s "recommended to use a bundler such as Rollup, Parcel, or Webpack to create a production-ready code bundle."

For someone that's:

  1. never used Rollup.js before, but found webpack to be painful
  2. really likes Ladda, but needs to use it on an oldschool LAMP site

... hitting a dead end like that stunk — just not as much as the thought of diving back down the webpack docs hole.

To help future Ladda users that find themselves in a similar situation — wanting to use the latest version instead of an outdated fork, and being stuck (for now) under an aging LAMP — I dropped in (thread jacked ... long story) a HOWTO over here.

The important bits are:

  1. Transpile Ladda:
rollup --name Ladda --globals spin.js:Spin --input ladda.js --format iife --file ladda.iife.js
  1. Transpile the Ladda dependency, Spin.js:
rollup --silent --name Spin --input spin.js --format umd --file spin.umd.js

... And you're done! The rest of the documented Ladda magic works great!


Would you guys be willing to drop a bundler example, like the two rollup cli lines above, into the README.md? ... Or would you accept a PR?

Look on the bright side, with any luck we won’t need bundlers soon!?

Thanks for considering this guys.

-Dan

cube-dan avatar Feb 07 '21 21:02 cube-dan