minify
minify copied to clipboard
Add option to ignore asm.js code
I'm wanting to minify a project which contains some Emscripten generated asm.js. As babili cannot safely minimise it and Emscripten already minimises the asm.js to a large extent, an option to ignore all code in an asm.js function would be very helpful.
Future work could selectively enable or disable transformations which are safe for asm.js, but for now a global switch would be great.
Are you using babili with babel-loader? you can ignore the files from the webpack config in that case.
No, I'm running it with the babili cli command. I also only want to ignore part of a file - the asm.js functions (with the pragma "use asm"). The rest should be minified.
We are working on the new CLI for babili which can help with this https://github.com/babel/babili/pull/507/
Also, you can try with babel cli for now like this.
babel <src> --out-dir <lib> --ignore asm.js
That will not help. I don't want to ignore a file, I want to ignore functions with the "use asm" pragma, as UglifyJS does.
Does this also affect the babel-generator's output as well?
Though Babili is a list of transformations, babel-generator minify: true takes care of squashing some numbers to its minimized form. Not sure if this has changed either.
Maybe Babel should stop doing everything except whitespace removal for minification, and leave all of the other optimizations to Babili.