fix(core): update

This commit is contained in:
Philipp Kunz 2020-03-09 14:36:55 +00:00
parent bad5690d99
commit dddd3ead1c
4 changed files with 24 additions and 8 deletions

6
package-lock.json generated
View File

@ -1222,9 +1222,9 @@
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
}, },
"@types/node": { "@types/node": {
"version": "13.7.7", "version": "13.9.0",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-13.7.7.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-13.9.0.tgz",
"integrity": "sha512-Uo4chgKbnPNlxQwoFmYIwctkQVkMMmsAoGGU4JKwLuvBefF0pCq4FybNSnfkfRCpC7ZW7kttcC/TrRtAJsvGtg==" "integrity": "sha512-0ARSQootUG1RljH2HncpsY2TJBfGQIKOOi7kxzUY6z54ePu/ZD+wJA8zI2Q6v8rol2qpG/rvqsReco8zNMPvhQ=="
}, },
"@types/relateurl": { "@types/relateurl": {
"version": "0.2.28", "version": "0.2.28",

View File

@ -20,11 +20,11 @@
"@gitzone/tsrun": "^1.2.8", "@gitzone/tsrun": "^1.2.8",
"@gitzone/tstest": "^1.0.28", "@gitzone/tstest": "^1.0.28",
"@pushrocks/tapbundle": "^3.2.0", "@pushrocks/tapbundle": "^3.2.0",
"@types/node": "^13.7.7",
"tslint": "^6.0.0", "tslint": "^6.0.0",
"tslint-config-prettier": "^1.15.0" "tslint-config-prettier": "^1.15.0"
}, },
"dependencies": { "dependencies": {
"@types/node": "^13.9.0",
"@babel/core": "^7.6.2", "@babel/core": "^7.6.2",
"@babel/plugin-proposal-class-properties": "^7.5.5", "@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-decorators": "^7.6.0", "@babel/plugin-proposal-decorators": "^7.6.0",

View File

@ -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(); tsBundleCli.startParse();
}; };

View File

@ -10,15 +10,15 @@ export class HtmlHandler {
} }
// copies the html // copies the html
public async copyHtml() { public async copyHtml(targetPathArg = this.targetFilePath) {
if (!(await this.checkIfExists())) { if (!(await this.checkIfExists())) {
return; return;
} }
await plugins.smartfile.fs.copy(this.sourceFilePath, this.targetFilePath); await plugins.smartfile.fs.copy(this.sourceFilePath, targetPathArg);
} }
// copies and minifies the html // copies and minifies the html
public async minifyHtml() { public async minifyHtml(targetPathArg = this.targetFilePath) {
if (!(await this.checkIfExists())) { if (!(await this.checkIfExists())) {
return; return;
} }
@ -33,6 +33,6 @@ export class HtmlHandler {
collapseInlineTagWhitespace: true, collapseInlineTagWhitespace: true,
removeComments: true removeComments: true
}); });
plugins.smartfile.memory.toFsSync(minifiedHtml, this.targetFilePath); plugins.smartfile.memory.toFsSync(minifiedHtml, targetPathArg);
} }
} }