fix(cli): Ensure ts_shared folder is compiled sedond to interfaces when present
This commit is contained in:
@ -37,14 +37,23 @@ export const runCli = async () => {
|
||||
*/
|
||||
tsbuildCli.addCommand('tsfolders').subscribe(async (argvArg) => {
|
||||
const tsFolders = await plugins.smartfile.fs.listFolders(paths.cwd, /^ts/);
|
||||
// lets make sure shared is always transpiled first
|
||||
const indexShared = tsFolders.indexOf('ts_shared');
|
||||
if (indexShared > -1) {
|
||||
tsFolders.splice(indexShared, 1);
|
||||
tsFolders.unshift('ts_interfaces');
|
||||
}
|
||||
|
||||
|
||||
// lets make sure interfaces are always transpiled first
|
||||
const index = tsFolders.indexOf('ts_interfaces');
|
||||
if (index > -1) {
|
||||
tsFolders.splice(index, 1);
|
||||
const indexInterfaces = tsFolders.indexOf('ts_interfaces');
|
||||
if (indexInterfaces > -1) {
|
||||
tsFolders.splice(indexInterfaces, 1);
|
||||
tsFolders.unshift('ts_interfaces');
|
||||
}
|
||||
const compilationCommandObject: { [key: string]: string } = {};
|
||||
console.log(`compiling in this order:`);
|
||||
console.log(tsFolders);
|
||||
for (const tsFolder of tsFolders) {
|
||||
compilationCommandObject[`./${tsFolder}/**/*.ts`] = `./dist_${tsFolder}`;
|
||||
}
|
||||
|
Reference in New Issue
Block a user