Putting aside my feelings on folks opting to distribute information via gists instead of their own websites, this gist from Andrew Levine does a great job summarizing the problems and challenges with efficiently distributing javascript via Magento 2’s standard systems. He includes some of the projects folks use to work around these issues, which I will wholesale TL;DR-yoink here — but the article isn’t too long, and you should read it.
- Hand-rolling configuration for the RequireJS optimizer (similar to Advanced Bundling docs)
- Using
WeareJH/config-gen
to generate a config for the RequireJS optimizer - Using
magento/m2-devtools
to generate a config for the RequireJS optimizer - Using
magesuite/magepack
to generate a config for the RequireJS optimizer