fix(core): update
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import * as plugins from './tsbuild.plugins.js';
|
||||
import * as plugins from './plugins.js';
|
||||
import * as paths from './paths.js';
|
||||
import * as tsbuild from './tsbuild.exports.js';
|
||||
|
||||
export const runCli = async () => {
|
||||
@ -23,7 +24,7 @@ export const runCli = async () => {
|
||||
*/
|
||||
tsbuildCli.addCommand('custom').subscribe(async (argvArg) => {
|
||||
const listedDirectories = argvArg._;
|
||||
listedDirectories.shift();
|
||||
listedDirectories.shift(); // removes the first element that is "custom"
|
||||
const compilationCommandObject: { [key: string]: string } = {};
|
||||
for (const directory of listedDirectories) {
|
||||
compilationCommandObject[`./${directory}/**/*.ts`] = `./dist_${directory}`;
|
||||
@ -31,15 +32,16 @@ export const runCli = async () => {
|
||||
await tsbuild.compileGlobStringObject(compilationCommandObject, {}, process.cwd(), argvArg);
|
||||
});
|
||||
|
||||
tsbuildCli.addCommand('element').subscribe(async (argvArg) => {
|
||||
await tsbuild.compileGlobStringObject(
|
||||
{
|
||||
'./ts_web/**/*.ts': 'dist_ts_web',
|
||||
},
|
||||
{},
|
||||
process.cwd(),
|
||||
{ web: true, ...argvArg }
|
||||
);
|
||||
/**
|
||||
* the custom command compiles any customDir to dist_customDir
|
||||
*/
|
||||
tsbuildCli.addCommand('tsfolders').subscribe(async (argvArg) => {
|
||||
const tsFolders = await plugins.smartfile.fs.listFolders(paths.cwd, /^ts/)
|
||||
const compilationCommandObject: { [key: string]: string } = {};
|
||||
for (const tsFolder of tsFolders) {
|
||||
compilationCommandObject[`./${tsFolder}/**/*.ts`] = `./dist_${tsFolder}`;
|
||||
}
|
||||
await tsbuild.compileGlobStringObject(compilationCommandObject, {}, process.cwd(), argvArg);
|
||||
});
|
||||
|
||||
tsbuildCli.startParse();
|
||||
|
Reference in New Issue
Block a user