File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ compile([
77 "none" ,
88 "--luaTarget" ,
99 "5.1" ,
10+ "--noHeader" ,
1011 "--outDir" ,
1112 "./dist/lualib" ,
1213 "--rootDir" ,
Original file line number Diff line number Diff line change @@ -18,9 +18,8 @@ export class CLIError extends Error {
1818}
1919
2020const optionDeclarations : { [ key : string ] : yargs . Options } = {
21- addHeader : {
22- alias : [ "ah" , "header" ] ,
23- default : true ,
21+ noHeader : {
22+ default : false ,
2423 describe : "Specify if a header will be added to compiled files." ,
2524 type : "boolean" ,
2625 } ,
Original file line number Diff line number Diff line change @@ -187,6 +187,14 @@ export abstract class LuaTranspiler {
187187 result += "local exports = exports or {}\n" ;
188188 }
189189
190+ // Inline lualib features
191+ if ( this . options . luaLibImport === LuaLibImportKind . Inline ) {
192+ for ( const feature of this . luaLibFeatureSet ) {
193+ const featureFile = path . resolve ( __dirname , `../dist/lualib/${ feature } .lua` ) ;
194+ result += fs . readFileSync ( featureFile ) + "\n" ;
195+ }
196+ }
197+
190198 // Transpile content statements
191199 this . exportStack . push ( [ ] ) ;
192200 this . sourceFile . statements . forEach ( s => result += this . transpileNode ( s ) ) ;
@@ -195,13 +203,6 @@ export abstract class LuaTranspiler {
195203 if ( this . isModule ) {
196204 result += "return exports\n" ;
197205 }
198-
199- if ( this . options . luaLibImport === LuaLibImportKind . Inline ) {
200- for ( const feature of this . luaLibFeatureSet ) {
201- const featureFile = path . resolve ( __dirname , `../dist/lualib/${ feature } .lua` ) ;
202- result += fs . readFileSync ( featureFile ) + "\n" ;
203- }
204- }
205206 return result ;
206207 }
207208
You can’t perform that action at this time.
0 commit comments