File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,7 +126,14 @@ export class LuaTransformer {
126126 ) ;
127127
128128 if ( this . options . luaEntry ) {
129- const sourceFile = this . program . getSourceFile ( this . options . luaEntry ) ;
129+ // If specified via CLI, the program's host should pick up a relative luaEntry path
130+ let luaEntryPath = this . options . luaEntry ;
131+ if ( this . options . project ) {
132+ // If specified via project. Figure out the full path to the file based off the project's path
133+ const tsconfigDirectory = path . dirname ( path . resolve ( this . options . project ) ) ;
134+ luaEntryPath = path . resolve ( tsconfigDirectory , this . options . luaEntry ) ;
135+ }
136+ const sourceFile = this . program . getSourceFile ( luaEntryPath ) ;
130137 if ( sourceFile ) {
131138 const formattedEntryName = tsHelper . getExportPath ( sourceFile . fileName , this . options ) ;
132139 const requireCall = this . createModuleRequire ( ts . createStringLiteral ( formattedEntryName ) , false ) ;
You can’t perform that action at this time.
0 commit comments