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

minify option #2

Open
MarcosCosmos opened this issue Jun 4, 2018 · 1 comment
Open

minify option #2

MarcosCosmos opened this issue Jun 4, 2018 · 1 comment

Comments

@MarcosCosmos
Copy link

MarcosCosmos commented Jun 4, 2018

Along with the existing pretty print, it may be useful to support minified code output.

I assume this won't be especially difficult since you're already using syntax trees?

@slava-sh
Copy link
Owner

I'm not aware of an existing Rust minifier.

The bundler currently runs rustfmt on a stringified TokenStream, which look like this:

fn main ( ) { println ! ( "Hello, world!" ) ; }

A simple way to "minify" the output would be to not run rustfmt and stringify the token stream in a way that doesn't include unnecessary whitespace.

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

No branches or pull requests

2 participants