Skip to content

Commit d2d1909

Browse files
authored
Add afterEmit plugin hook
This function would run after Lua files have been written to disk (in order to allow plugins to perform post-build tasks such as optimizing/minifying/obfuscating/bytecode-compilation/etc).
1 parent 6b068dc commit d2d1909

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/transpilation/transpiler.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ export class Transpiler {
9090
}
9191
}
9292

93+
for (const plugin of plugins) {
94+
if (plugin.afterEmit) {
95+
const beforeEmitPluginDiagnostics = plugin.afterEmit(program, options, this.emitHost, emitPlan) ?? [];
96+
diagnostics.push(...beforeEmitPluginDiagnostics);
97+
}
98+
}
99+
93100
if (options.tstlVerbose) {
94101
console.log("Emit finished!");
95102
}

0 commit comments

Comments
 (0)