Skip to content

Commit 6a200c9

Browse files
authored
Fix using tstl CLI to build lualib (#1233)
1 parent 96647da commit 6a200c9

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/LuaLib.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,11 @@ export function readLuaLibFeature(feature: LuaLibFeature, emitHost: EmitHost): s
130130
return luaLibFeature;
131131
}
132132

133-
export function resolveRecursiveLualibFeatures(features: Iterable<LuaLibFeature>, emitHost: EmitHost): LuaLibFeature[] {
134-
const luaLibModulesInfo = getLuaLibModulesInfo(emitHost);
133+
export function resolveRecursiveLualibFeatures(
134+
features: Iterable<LuaLibFeature>,
135+
emitHost: EmitHost,
136+
luaLibModulesInfo: LuaLibModulesInfo = getLuaLibModulesInfo(emitHost)
137+
): LuaLibFeature[] {
135138
const loadedFeatures = new Set<LuaLibFeature>();
136139
const result: LuaLibFeature[] = [];
137140

src/lualib-build/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class LuaLibPlugin implements tstl.Plugin {
4848

4949
// Figure out the order required in the bundle by recursively resolving all dependency features
5050
const allFeatures = Object.values(LuaLibFeature) as LuaLibFeature[];
51-
const orderedFeatures = resolveRecursiveLualibFeatures(allFeatures, emitHost);
51+
const orderedFeatures = resolveRecursiveLualibFeatures(allFeatures, emitHost, luaLibModuleInfo);
5252

5353
// Concatenate lualib files into bundle with exports table and add lualib_bundle.lua to results
5454
let lualibBundle = orderedFeatures.map(f => exportedLualibFeatures.get(LuaLibFeature[f])).join("\n");

src/lualib/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"tstl": {
1313
"luaLibImport": "none",
1414
"noHeader": true,
15-
"luaPlugins": [{ "name": "../lualib-build/plugin.ts" }]
15+
"luaPlugins": [{ "name": "../../dist/lualib-build/plugin.js" }]
1616
}
1717
}

0 commit comments

Comments
 (0)