Search code examples
luacompilationsquish

How to setup and use lua squish?


I know it can be a dumb question , but how i can setup and use squish to compile my lua scripts. I'm tired searching google and i can't find anything to explain me how to use

Someone can point me on right direction

  • I use lua 5.1 on windows OS

Thank you


Solution

  • First download and unpack the archive containing Squish's code. Alternatively, you may clone the repository. The change into the directory containing the squish.lua file. You will also need a Lua 5.1 executable (which I'll assume is called lua51.exe in the commands below).

    The Unix Makefile in the archive contains roughly the following commands (translated to Windows) to build the squish tool:

    • bootstrap squish tool (without gzip compression or debug support for now)

      lua51.exe squish.lua -q --with-minify --with-uglify --with-compile --with-virtual-io
      
    • prepare gzip compression modules

      lua51.exe squish -q gzip
      
    • prepare debug support

      lua51.exe squish -q debug
      
    • build final tool (with gzip compression and debug support)

      lua51.exe squish -q --with-minify --with-uglify --with-compile --with-virtual-io --with-gzip --with-debug
      

    The result is a Lua script squish (without the .lua extension) in the current directory. To use it you have to write a squishy file for your project and execute a command line similar to the last one above in the directory containing your squishy file.