lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sat, Sep 14, 2013 at 9:49 PM, Thijs Schreijer
<thijs@thijsschreijer.nl> wrote:
>
>> -----Original Message-----
>> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
>> Behalf Of Alexander Gladysh
>> Sent: zaterdag 14 september 2013 19:08
>> To: Lua mailing list
>> Subject: Squish source maps
>>
>> Hi, list!
>>
>> We use Squish[1] as a tool to pack and minify a bunch of Lua source code
>> files.
>>
>> It works nicely, but error messages and stack traces are, obviously, a
>> bit hard to comprehend.
>>
>> Did anyone implement something akin to JavaScript source maps[2] for
>> Squish (preferably supporting mapping line numbers as well)?
>>
>> I guess it would require some changes to how minified code is
>> generated — to place each function call on a separate line, but it
>> should not affect resulting code size.
>>
>> Best,
>> Alexander.
>>
>> [1] — http://matthewwild.co.uk/projects/squish/home
>> [2] — https://developers.google.com/chrome-developer-
>> tools/docs/javascript-debugging#source-maps
>
> Have you tried the debug minification? It's mentioned a bit below on the 'debug' heading, that 'debug' is a valid value for '--minify-level' (not mentioned at minify itself)
>
> From the readme;
>>> Note: Minification may interfere with the line number calculation,
>>> use --minify-level=debug to enable all features of minify that don't
>>> change line numbers, and everything will be fine.

Thanks, but preserving line numbers alone wouldn't help:

1. There are many Lua files in a single minified file.
2. Function names in stack trace are still skewed.

Alexander.