Skip to Content
defold-typescript libraries
defold (official)

defold/extension-lua-preprocessor

A Lua preprocessor that hooks into the Lua builder plugin system in bob, the Defold build tool. It strips or keeps code at build time based on --#IF, --#ELSE and --#ENDIF blocks that test the RELEASE, DEBUG or HEADLESS keywords.

No Lua API — content, shaders, build-time tooling or engine-side native code only.

  • GitHub: defold/extension-lua-preprocessor — pinned to 1.2.0 (released while Defold 1.12.0 was current)
    1. Pick a release from defold/extension-lua-preprocessor releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Use Defold 1.4.2 or higher.
    3. Wrap code in the conditional comment blocks.
    4. Write --DEBUG_ASSERT(...) to include an assert only in debug builds.