Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
0bc8048ac5 | |||
65754d34bc |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsbundle",
|
"name": "@gitzone/tsbundle",
|
||||||
"version": "1.0.27",
|
"version": "1.0.28",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsbundle",
|
"name": "@gitzone/tsbundle",
|
||||||
"version": "1.0.27",
|
"version": "1.0.28",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a bundler using rollup for painless bundling of web projects",
|
"description": "a bundler using rollup for painless bundling of web projects",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -5,8 +5,15 @@ export class HtmlHandler {
|
|||||||
public sourceFilePath: string = plugins.path.join(paths.htmlDir, 'index.html');
|
public sourceFilePath: string = plugins.path.join(paths.htmlDir, 'index.html');
|
||||||
public targetFilePath: string = plugins.path.join(paths.distWebDir, '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
|
// copies the html
|
||||||
public async copyHtml() {
|
public async copyHtml() {
|
||||||
|
if (!(await this.checkIfExists)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await plugins.smartfile.fs.copy(
|
await plugins.smartfile.fs.copy(
|
||||||
this.sourceFilePath,
|
this.sourceFilePath,
|
||||||
this.targetFilePath
|
this.targetFilePath
|
||||||
@ -15,6 +22,9 @@ export class HtmlHandler {
|
|||||||
|
|
||||||
// copies and minifies the html
|
// copies and minifies the html
|
||||||
public async minifyHtml() {
|
public async minifyHtml() {
|
||||||
|
if (!(await this.checkIfExists)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const fileString = plugins.smartfile.fs.toStringSync(this.sourceFilePath);
|
const fileString = plugins.smartfile.fs.toStringSync(this.sourceFilePath);
|
||||||
const minifiedHtml = plugins.htmlMinifier.minify(fileString, {
|
const minifiedHtml = plugins.htmlMinifier.minify(fileString, {
|
||||||
minifyCSS: true,
|
minifyCSS: true,
|
||||||
|
Reference in New Issue
Block a user