1847 posts
Location
/home/dannysmc95
Posted 25 May 2016 - 04:49 PM
Hey guys,
I have one other question, has anyone made a way an API (in lua) where I can give it a file and it will minify it, so removing extra whitespace, linebreaks and removing comments?
Thanks,
Danny
1426 posts
Location
Does anyone put something serious here?
Posted 25 May 2016 - 05:14 PM
Howl comes
with a minifier. You can always look at extracting out the minifier into a separate program (modify
this line to be "howl/lexer/*" instead) then build it. Alternatively you can always use Howl :)/>.
Edited on 25 May 2016 - 03:14 PM
1847 posts
Location
/home/dannysmc95
Posted 25 May 2016 - 05:33 PM
Howl comes
with a minifier. You can always look at extracting out the minifier into a separate program (modify
this line to be "howl/lexer/*" instead) then build it. Alternatively you can always use Howl :)/>/>.
Thanks for that!! How would I use it?
3057 posts
Location
United States of America
Posted 25 May 2016 - 05:37 PM
1847 posts
Location
/home/dannysmc95
Posted 25 May 2016 - 05:43 PM
Yes that is exactly what I am looking for, but just done in Lua :P/>.
1426 posts
Location
Does anyone put something serious here?
Posted 25 May 2016 - 05:56 PM
Thanks for that!! How would I use it?
There is a
pastebin of it (I made this for someone a while back and it isn't 100% up to date). If you load it with os.loadAPI then use <api>.Rebuild.minifyFile(in, out) or <api>.Rebuild.MinifyString(in).
1610 posts
Posted 25 May 2016 - 06:38 PM
That one isn't perfect. I had (as a test) fed it one of my programs that was over 1000 lines long with 40 KB of code, and there was a syntax error in the result. I didn't bother looking for the problem.