Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to ignore asm.js code #599

Open
curiousdannii opened this issue Jun 22, 2017 · 6 comments
Open

Add option to ignore asm.js code #599

curiousdannii opened this issue Jun 22, 2017 · 6 comments

Comments

@curiousdannii
Copy link

curiousdannii commented Jun 22, 2017

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.

@vigneshshanmugam
Copy link
Member

Are you using babili with babel-loader? you can ignore the files from the webpack config in that case.

@curiousdannii
Copy link
Author

curiousdannii commented Jun 22, 2017

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.

@vigneshshanmugam
Copy link
Member

We are working on the new CLI for babili which can help with this #507

Also, you can try with babel cli for now like this.

babel <src> --out-dir <lib> --ignore asm.js

@curiousdannii
Copy link
Author

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.

@boopathi
Copy link
Member

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.

@j-f1
Copy link
Contributor

j-f1 commented Jun 22, 2017

Maybe Babel should stop doing everything except whitespace removal for minification, and leave all of the other optimizations to Babili.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants