Ladda
Ladda copied to clipboard
Add bundling hints to the README?
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:
- never used Rollup.js before, but found webpack to be painful
- 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:
- Transpile Ladda:
rollup --name Ladda --globals spin.js:Spin --input ladda.js --format iife --file ladda.iife.js
- 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