Would like to mention that there are already tools like https://github.com/mishoo/UglifyJS (ES5-only) and https://github.com/terser/terser (ultimately forked from the former to add support for ES2015+ code) that do more or less what you're proposing here, but go a lot further to minify code by replacing variable names, rearranging code, removing dead code, changing if/else statements into ternaries, and so on. I personally would recommend downloading a proper minifier like one of those and using that instead for the use case you seem to be interested in.
On Saturday, April 30, 2022 at 2:28:47 PM UTC-7 arang...@gmail.com wrote: > Hi all, > I am considering writing a small piece of code that uses regular > expressions to remove all comments and newlines from JS code. This could > possibly reduce the memory consumption of V8. Has this already been > implemented and where would I put this code? > Thanks, > S. Rangwalla > -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/6484ff10-16d2-4ddb-be08-22d6eed6c0a5n%40googlegroups.com.