The repository provides the transformer and post-build, pre-build utilities.
These utilities and transformers can be used with TypescriptToLua package.
The transformer provides:
-
TypeScript
import
removing: Result Lua file should not have anyrequires
calls -
TypeScript
export
(and inlinedexport
) replace: All exported statements will be written to Lua's_G
. Example -
File side checking: You cannot mix
import ... from '.../client'
andimport ... from '.../server'
Insert into tsconfig.json
:
{
"compilerOptions": {
// ...
"plugins": [
{
"transform": "mtasa-lua-utils/transformer",
"after": false,
"externalImports": true, //dont remove non mta imports (Default: false)
"globalExports": false //dont replace exports to global (Default: true)
}
],
// ...
}
}
Checks compiled lua files correctness:
- Are the files provided in
meta.xml
Insert into package.json
:
{
// ...
"scripts": {
"postbuild": "mtasa-utils-postbuild",
},
// ...
}