Compare commits

...

6 Commits

Author SHA1 Message Date
8f17a3c92a 1.0.29 2019-07-17 12:00:04 +02:00
65221425ca fix(core): update 2019-07-17 12:00:04 +02:00
0bc8048ac5 1.0.28 2019-07-17 11:54:50 +02:00
65754d34bc fix(core): update 2019-07-17 11:54:49 +02:00
c4a276ebf3 1.0.27 2019-06-17 07:06:57 +02:00
3db075b795 fix(core): update 2019-06-17 07:06:56 +02:00
4 changed files with 980 additions and 2110 deletions

2888
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@gitzone/tsbundle",
"version": "1.0.26",
"version": "1.0.29",
"private": false,
"description": "a bundler using rollup for painless bundling of web projects",
"main": "dist/index.js",
@ -20,7 +20,7 @@
"@gitzone/tsrun": "^1.2.6",
"@gitzone/tstest": "^1.0.15",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^11.13.8",
"@types/node": "^12.6.6",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0"
},
@ -35,16 +35,16 @@
"@pushrocks/smartcli": "^3.0.7",
"@pushrocks/smartfile": "^7.0.2",
"@pushrocks/smartlog": "^2.0.19",
"@pushrocks/smartlog-destination-local": "^7.0.5",
"@pushrocks/smartlog-destination-local": "^8.0.2",
"@types/html-minifier": "^3.5.3",
"html-minifier": "^4.0.0",
"rollup": "^1.10.1",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-node-resolve": "^4.2.3",
"rollup-plugin-commonjs": "^10.0.1",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.0.0",
"rollup-plugin-typescript2": "^0.21.0"
"rollup-plugin-typescript2": "^0.22.0"
},
"files": [
"ts/*",

View File

@ -9,16 +9,14 @@ export const runCli = async () => {
const tsbundle = new TsBundle();
const htmlHandler = new HtmlHandler();
switch (true) {
case argvArg.production:
case (argvArg.production) || process.env.CI:
await tsbundle.buildProduction();
await htmlHandler.minifyHtml();
break;
case argvArg.test:
default:
await tsbundle.buildTest();
await htmlHandler.copyHtml();
break;
default:
logger.log('error', `Can not determine build target environement. Please specify via --production or --test`)
return;
}
});

View File

@ -5,8 +5,15 @@ export class HtmlHandler {
public sourceFilePath: string = plugins.path.join(paths.htmlDir, 'index.html');
public targetFilePath: string = plugins.path.join(paths.distWebDir, 'index.html');
public async checkIfExists () {
return plugins.smartfile.fs.fileExists(this.sourceFilePath);
}
// copies the html
public async copyHtml() {
if (!(await this.checkIfExists)) {
return;
}
await plugins.smartfile.fs.copy(
this.sourceFilePath,
this.targetFilePath
@ -15,6 +22,9 @@ export class HtmlHandler {
// copies and minifies the html
public async minifyHtml() {
if (!(await this.checkIfExists)) {
return;
}
const fileString = plugins.smartfile.fs.toStringSync(this.sourceFilePath);
const minifiedHtml = plugins.htmlMinifier.minify(fileString, {
minifyCSS: true,