[email protected] is faster than babel 6+, can be installed globally and works out of the box. It just... you know, does what versions 1, 2, 3 & 4 did: compile ES2015 into ES5. So I just use that. Not every project is a "node" project that is already dumping megabytes of dependencies into the project directory. I don't want to have to buy into an entire ecosystem just to use one tool—a shim, at that.
babel --es2015 --babeli infile.js -o outfile.js.
https://github.com/babel/babili/blob/master/packages/babili/...
I was thinking about using bundledDependencies or maybe just running webpack/rollup over the whole thing, feel free to make an issue.
With all the other minifiers out there the only real draw here is you're already using babel so toss the minifier at it. If anyone, other than for the novelty of it being new, actually downloads babel ONLY to use the minifier I will eat my hat.
Most will be transpiling that ES6 into ES5 so support isn't that necessary.
> And also, once we start doing advanced optimizations you might want to marinate that hat in some nice sauce.
Better optimizations than Google Closure and / or Uglifier? Color me skeptical and good luck :)
Yes, it doesn't need to be 33M that's just a result of the way it was used (babel-cli is that big) and I'm saying that it's something that we can fix
Babel will look for a .babelrc in the current directory of the file being transpiled. If one does not exist, it will travel up the directory tree until it finds either a .babelrc, or a package.json with a "babel": {} hash within.
- https://babeljs.io/docs/usage/babelrc/
So if you have stray files lying around, they might break your build.
Babili has a single preset too, so it's also really easy to add. And, because it's using the same parse tree from your transpilation step, it doesn't add a ton of overhead to run it.
At a usability level, babili has a 33M install footprint and must be installed locally in the directory in which you intend to use it.
uglify-js can be installed globally and has a 1.9M install size.
And I've never understood how to configure babel's preset and plugin files. Why is it necessary for a minifier to do this? Surely this can be greatly simplified.