Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
ac3ef390e8 | |||
7ca9c52cc7 | |||
0c702029f2 | |||
dddd3ead1c | |||
bad5690d99 | |||
a8fb7aac7f |
8
package-lock.json
generated
8
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitzone/tsbundle",
|
||||
"version": "1.0.49",
|
||||
"version": "1.0.52",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -1222,9 +1222,9 @@
|
||||
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "13.7.7",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-13.7.7.tgz",
|
||||
"integrity": "sha512-Uo4chgKbnPNlxQwoFmYIwctkQVkMMmsAoGGU4JKwLuvBefF0pCq4FybNSnfkfRCpC7ZW7kttcC/TrRtAJsvGtg=="
|
||||
"version": "13.9.0",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-13.9.0.tgz",
|
||||
"integrity": "sha512-0ARSQootUG1RljH2HncpsY2TJBfGQIKOOi7kxzUY6z54ePu/ZD+wJA8zI2Q6v8rol2qpG/rvqsReco8zNMPvhQ=="
|
||||
},
|
||||
"@types/relateurl": {
|
||||
"version": "0.2.28",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitzone/tsbundle",
|
||||
"version": "1.0.49",
|
||||
"version": "1.0.52",
|
||||
"private": false,
|
||||
"description": "a bundler using rollup for painless bundling of web projects",
|
||||
"main": "dist/index.js",
|
||||
@ -20,11 +20,11 @@
|
||||
"@gitzone/tsrun": "^1.2.8",
|
||||
"@gitzone/tstest": "^1.0.28",
|
||||
"@pushrocks/tapbundle": "^3.2.0",
|
||||
"@types/node": "^13.7.7",
|
||||
"tslint": "^6.0.0",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "^13.9.0",
|
||||
"@babel/core": "^7.6.2",
|
||||
"@babel/plugin-proposal-class-properties": "^7.5.5",
|
||||
"@babel/plugin-proposal-decorators": "^7.6.0",
|
||||
|
@ -34,7 +34,7 @@ export class TsBundle {
|
||||
inlineSourceMap: true,
|
||||
noEmitOnError: true,
|
||||
lib: ['esnext', 'dom'],
|
||||
target: 'es2017',
|
||||
target: 'es2018',
|
||||
noImplicitAny: false
|
||||
}
|
||||
}
|
||||
|
@ -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('./ts_web/index.ts', './dist_ts_web/bundle.js');
|
||||
// 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