fix(core): update

This commit is contained in:
2022-03-14 16:32:12 +01:00
parent 5f92b58353
commit 3c9b178c09
21 changed files with 660 additions and 389 deletions

View File

@ -1,11 +1,11 @@
import * as plugins from './tsbundle.plugins';
import { TsBundle } from './tsbundle.class.tsbundle';
import { HtmlHandler } from './tsbundle.htmlhandler';
import { logger } from './tsbundle.logging';
import * as plugins from './tsbundle.plugins.js';
import { TsBundle } from './tsbundle.class.tsbundle.js';
import { HtmlHandler } from './tsbundle.htmlhandler.js';
import { logger } from './tsbundle.logging.js';
export const runCli = async () => {
const tsBundleCli = new plugins.smartcli.Smartcli();
tsBundleCli.standardTask().subscribe(async argvArg => {
tsBundleCli.standardTask().subscribe(async (argvArg) => {
const tsbundle = new TsBundle();
// const htmlHandler = new HtmlHandler();
switch (true) {
@ -21,23 +21,32 @@ export const runCli = async () => {
}
});
tsBundleCli.addCommand('element').subscribe(async argvArg => {
tsBundleCli.addCommand('element').subscribe(async (argvArg) => {
const tsbundle = new TsBundle();
// const htmlHandler = new HtmlHandler();
switch (true) {
case argvArg.production || process.env.CI:
await tsbundle.buildProduction(process.cwd(), './ts_web/index.ts', './dist_bundle/bundle.js');
await tsbundle.buildProduction(
process.cwd(),
'./ts_web/index.ts',
'./dist_bundle/bundle.js'
);
// await htmlHandler.minifyHtml();
break;
case argvArg.test:
default:
await tsbundle.buildTest(process.cwd(), './ts_web/index.ts', './dist_bundle/bundle.js', 'rollup');
await tsbundle.buildTest(
process.cwd(),
'./ts_web/index.ts',
'./dist_bundle/bundle.js',
'rollup'
);
// await htmlHandler.copyHtml();
return;
}
});
tsBundleCli.addCommand('npm').subscribe(async argvArg => {
tsBundleCli.addCommand('npm').subscribe(async (argvArg) => {
const tsbundle = new TsBundle();
// const htmlHandler = new HtmlHandler();
switch (true) {
@ -47,23 +56,37 @@ export const runCli = async () => {
break;
case argvArg.test:
default:
await tsbundle.buildTest(process.cwd(), './ts/index.ts', './dist_bundle/bundle.js', 'rollup');
await tsbundle.buildTest(
process.cwd(),
'./ts/index.ts',
'./dist_bundle/bundle.js',
'rollup'
);
// await htmlHandler.copyHtml();
return;
}
});
tsBundleCli.addCommand('website').subscribe(async argvArg => {
tsBundleCli.addCommand('website').subscribe(async (argvArg) => {
const tsbundle = new TsBundle();
const htmlHandler = new HtmlHandler();
switch (true) {
case argvArg.production || process.env.CI:
await tsbundle.buildProduction(process.cwd(), './ts_web/index.ts', './dist_serve/bundle.js');
await tsbundle.buildProduction(
process.cwd(),
'./ts_web/index.ts',
'./dist_serve/bundle.js'
);
await htmlHandler.minifyHtml();
break;
case argvArg.test:
default:
await tsbundle.buildTest(process.cwd(), './ts_web/index.ts', './dist_serve/bundle.js', 'rollup');
await tsbundle.buildTest(
process.cwd(),
'./ts_web/index.ts',
'./dist_serve/bundle.js',
'rollup'
);
await htmlHandler.copyHtml();
return;
}