Jump to content




Lua file minifier?

api help lua

6 replies to this topic

#1 DannySMc

  • Members
  • 1,808 posts
  • Location/home/dannysmc95

Posted 25 May 2016 - 03: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

#2 SquidDev

    Frickin' laser beams

  • Members
  • 1,404 posts
  • LocationDoes anyone put something serious here?

Posted 25 May 2016 - 04: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 by SquidDev, 25 May 2016 - 04:14 PM.


#3 DannySMc

  • Members
  • 1,808 posts
  • Location/home/dannysmc95

Posted 25 May 2016 - 04:33 PM

View PostSquidDev, on 25 May 2016 - 04:14 PM, said:

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?

#4 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 25 May 2016 - 04:37 PM

I used this one on stitch.

#5 DannySMc

  • Members
  • 1,808 posts
  • Location/home/dannysmc95

Posted 25 May 2016 - 04:43 PM

View PostKingofGamesYami, on 25 May 2016 - 04:37 PM, said:

I used this one on stitch.

Yes that is exactly what I am looking for, but just done in Lua :P.

#6 SquidDev

    Frickin' laser beams

  • Members
  • 1,404 posts
  • LocationDoes anyone put something serious here?

Posted 25 May 2016 - 04:56 PM

View PostDannySMc, on 25 May 2016 - 04:33 PM, said:

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).

#7 apemanzilla

  • Members
  • 1,421 posts

Posted 25 May 2016 - 05:38 PM

View PostKingofGamesYami, on 25 May 2016 - 04:37 PM, said:

I used this one on stitch.

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users