closure-compiler
closure-compiler copied to clipboard
Is it possible to not add line breaks every 500 characters?
google/closure-compiler intentionally adds a line break after every 500 characters.
Is there a way to prevent this behavior, and not add these line breaks, or could this be added as an option, please?
It looks like there is a setter for this on CompilerOptions (if you have your own subclass of either CommandLineRunner or AbstractCommandLineRunner, or if you directly create your own Compiler instance), but this isn't presently exposed via command line flags.
https://github.com/google/closure-compiler/blob/ff2c49e5a0f0fedae10e2a01a3b8326aad1a0c0f/src/com/google/javascript/jscomp/CompilerOptions.java#L65-L66 https://github.com/google/closure-compiler/blob/ff2c49e5a0f0fedae10e2a01a3b8326aad1a0c0f/src/com/google/javascript/jscomp/CompilerOptions.java#L973 https://github.com/google/closure-compiler/blob/ff2c49e5a0f0fedae10e2a01a3b8326aad1a0c0f/src/com/google/javascript/jscomp/CompilerOptions.java#L2489-L2491
Yes, setting it to 0 will tell it not to break at all.
Yes, setting it to 0 will tell it not to break at all.
How do I set it to 0? (I use the command line)
It seems we haven't exposed a command-line option for setting this value.
Here's the file where one would add that and an example option to copy.
https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/CommandLineRunner.java#L217
If you'd like to submit a PR, we'll be happy to review and merge it.
Or you could just change the constant value in your download of our sources and rebuild.