Without an explicit rootDir, tstl computed output paths relative to
tsconfig.json's own directory (modules/events-mod/) rather than the
actual TypeScript source root (src/main/typescript/), so control.lua
and settings.lua ended up nested under src/main/typescript/ in the
packaged mod zip instead of at its root - where Factorio requires them
to be. The mod would not have loaded at all as packaged.
This went uncaught because packageFactorioMod never previously
produced real output (blocked by the now-fixed kxs-ts-gen-core/JitPack
issue). Verified by actually running packageFactorioMod and inspecting
the resulting zip: control.lua, settings.lua and info.json are now at
the root, and control.lua's require() calls ("main.global-init" etc.)
correctly resolve against that flat layout.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
46 lines
1.2 KiB
JSON
46 lines
1.2 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/TypeScriptToLua/vscode-typescript-to-lua/master/tsconfig-schema.json",
|
|
"compilerOptions": {
|
|
"target": "esnext",
|
|
"lib": [
|
|
"esnext"
|
|
],
|
|
"module": "commonjs",
|
|
"moduleResolution": "node",
|
|
"rootDir": "./src/main/typescript",
|
|
"types": [
|
|
"@typescript-to-lua/language-extensions",
|
|
"lua-types/5.2",
|
|
"typed-factorio/runtime"
|
|
],
|
|
"plugins": [
|
|
{
|
|
"name": "typescript-tstl-plugin"
|
|
}
|
|
],
|
|
"allowSyntheticDefaultImports": true,
|
|
"esModuleInterop": true,
|
|
"explainFiles": false,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"listEmittedFiles": true,
|
|
"listFiles": true,
|
|
"noFallthroughCasesInSwitch": true,
|
|
"noImplicitAny": true,
|
|
"noImplicitOverride": true,
|
|
"noImplicitReturns": true,
|
|
"noImplicitThis": true,
|
|
"sourceMap": false,
|
|
"strict": true,
|
|
"strictFunctionTypes": true,
|
|
"strictNullChecks": true,
|
|
"traceResolution": false
|
|
},
|
|
"tstl": {
|
|
"luaTarget": "5.2",
|
|
"tstlVerbose": false,
|
|
"noHeader": true,
|
|
"noImplicitSelf": true,
|
|
"sourceMapTraceback": false,
|
|
"luaLibImport": "require"
|
|
}
|
|
}
|