Skip to content

Commit

Permalink
Include main.ts last
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Jan 27, 2024
1 parent c7af2fd commit e3bae14
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions make.js
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ function writeTSProject(projectdir, projectFiles, options) {
}
};

let main_ts = null;

for (let i = 0; i < options.sources.length; ++i) {
if (fs.existsSync(options.sources[i])) {
let files = fs.readdirSync(options.sources[i]);
Expand All @@ -820,11 +822,19 @@ function writeTSProject(projectdir, projectFiles, options) {
}
}
tsdata.include.push(options.sources[i] + "/" + file);

if (file == "main.ts") main_ts = options.sources[i] + "/" + file;
}
}
}
}

// Include main.ts last
if (main_ts != null) {
tsdata.include.splice(tsdata.include.indexOf(main_ts), 1);
tsdata.include.push(main_ts);
}

fs.writeFileSync(path.join(projectdir, 'tsconfig.json'), JSON.stringify(tsdata, null, 4));

// Hermes compiler
Expand Down

0 comments on commit e3bae14

Please sign in to comment.