fix(core): update
This commit is contained in:
@ -21,5 +21,21 @@ export const runCli = async () => {
|
||||
}
|
||||
});
|
||||
|
||||
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('./ts_web/index.ts', './dist_ts_web/bundle.js');
|
||||
// await htmlHandler.minifyHtml();
|
||||
break;
|
||||
case argvArg.test:
|
||||
default:
|
||||
await tsbundle.buildTest(argvArg.from, argvArg.to);
|
||||
// await htmlHandler.copyHtml();
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
tsBundleCli.startParse();
|
||||
};
|
||||
|
@ -10,15 +10,15 @@ export class HtmlHandler {
|
||||
}
|
||||
|
||||
// copies the html
|
||||
public async copyHtml() {
|
||||
public async copyHtml(targetPathArg = this.targetFilePath) {
|
||||
if (!(await this.checkIfExists())) {
|
||||
return;
|
||||
}
|
||||
await plugins.smartfile.fs.copy(this.sourceFilePath, this.targetFilePath);
|
||||
await plugins.smartfile.fs.copy(this.sourceFilePath, targetPathArg);
|
||||
}
|
||||
|
||||
// copies and minifies the html
|
||||
public async minifyHtml() {
|
||||
public async minifyHtml(targetPathArg = this.targetFilePath) {
|
||||
if (!(await this.checkIfExists())) {
|
||||
return;
|
||||
}
|
||||
@ -33,6 +33,6 @@ export class HtmlHandler {
|
||||
collapseInlineTagWhitespace: true,
|
||||
removeComments: true
|
||||
});
|
||||
plugins.smartfile.memory.toFsSync(minifiedHtml, this.targetFilePath);
|
||||
plugins.smartfile.memory.toFsSync(minifiedHtml, targetPathArg);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user