Okay, something I’ve been wondering for a while.
A lot of my projects are small/medium WP sites. Most of the time the amount of JavaScript needed is fairly small, so I tend to separate components into individual vanilla JS files, and then use webpack to run these through babel and concatenate into a single JS file which is sent over the wire.
This clearly doesn’t scale well, and it feels like there must be a better approach that also automatically splits components so each page only receives what it needs. We’re still talking a pretty small amount of JS most of the time, so I’ve always thought a framework would be overkill, but I’ve had trouble finding articles/tutorials about JS workflows at this scale.
What is everyone else doing? Am I being naïve by avoiding frameworks? This has been a blind spot in my project workflow for a while, so now seems like a good time to finally get it sorted!