Skip to content

Configuration

Most of the build pipeline is driven by two files: tsconfig.json and package.json.

tsconfig.json

The tstl section configures TypeScriptToLua and the grandma3-tstl-plugin packaging step.

jsonc
{
	"tstl": {
		"luaTarget": "5.4",
		"noHeader": true,
		"luaBundle": "dist",
		"luaBundleEntry": "src/plugin.ts",
		"noImplicitSelf": true,
		"luaPlugins": [{ "name": "grandma3-tstl-plugin", "license": "src/LICENSE" }],
	},
}
FieldPurpose
luaTargetMA3 runs Lua 5.4 (as of MA3 2.4). Keep aligned with the host MA3 version.
luaBundleA directory. The bundle is written as <luaBundle>/<package-name>.lua.
luaBundleEntryEntry-point .ts file.
luaPlugins[0].licensePath (relative to the project) to a license file that's prepended to the compiled bundle as Lua comments. Omit to disable the prepend.

package.json fields the build reads

json
{
	"name": "my-plugin",
	"version": "0.0.1",
	"author": "Max Mustermann",
	"gma_version": "2.4.2.2"
}
FieldUsed for
nameThe output filenames (dist/<name>.lua, dist/<name>.xml) and the Plugin Name / ComponentLua Name attributes in the XML.
versionThe Plugin Version attribute in the XML.
authorThe Plugin Author attribute in the XML; also substitutes [fullname] in the prepended license.
gma_versionThe XML's <GMA3 DataVersion="..."> — should match the MA3 version your plugin targets.

Released under the MIT License.