tstl-remove-debug
v1.1.0
Published
TypeScriptToLua plugin that removes debugging expressions
Downloads
3
Readme
tstl-remove-debug
TypeScriptToLua plugin that strips calls to print, pprint, assert, and any functions attached to profiler and debug. Also replaces the statement sys.get_engine_info().is_debug with false.
The purpose is to reduce code size for production builds.
:exclamation: Use this and any code transformation plugin with caution. Mistakes are possible.
Example
print(foo);
pprint(foo);
assert(foo === '');
profiler.start();
debug.draw_text('');
const is_debug = sys.get_engine_info().is_debug;Becomes:
-- (This space intentionally left blank)
local is_debug = falseInstallation
Requires TSTL >= 1.22.0.
- Install this plugin
yarn add tstl-remove-debug -D
# or
npm install tstl-remove-debug --save-dev- Add
tstl-remove-debugtotstl.luaPluginsintsconfig.json
{
"tstl": {
"luaPlugins": [
+ { "name": "tstl-remove-debug" }
],
}
}License
CC0
