I keep my node_modules folder in ES5. If I’m actively working on a private NPM dep, I can stick a babel watcher on it & symlink it into my project, no sweat. The goal is to hide my entire node_modules from webpack to keep load times fast.
Webpack 2 will offer tree shaking in the future, but it already offers something similar, only following requires from your entry modules. If A requires B and B requires C and D, then webpack does a depth-first traversal to figure out everything needed. Alternatively, I could tell webpack to jump right to requiring B so it doesn’t have to wait to finish walking A. That’s a prefetch. It’ll shave off a second or 2.
Joi is… a package under the hapijs family of packages. The stance of the hapijs folks is “I’m right, you’re wrong, fuck you.” Not kidding: http://hueniverse.com/2016/01/26/how-to-use-open-source-and-shut-the-fuck-up-at-the-same-time/ hapijs (and it’s hapijs dependents) publishes source & says builds are my problem, despite 99.99999% of NPM packages being builds, not source. An ideal solution would be for someone to write Joi for the browser, free of bloat & stubbornness (attempts have been made, see the joi issues), but that ain’t me. Now that I’m using GraphQL, in the future I’ll write custom GraphQLScalars and send those to the client & ditch Joi. No bloat, no fuss.