Skip to content

Commit

Permalink
Merge branch 'trunk'
Browse files Browse the repository at this point in the history
* trunk:
  add compressed version of HTML with extention *.min.html
  • Loading branch information
xvoland committed May 24, 2021
2 parents 0e01db2 + 12515b2 commit 2f7aa2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is a template for typical projects that are generated automatically by the GULP (NodeJS).

This is Gulp-template script automatically generates SVG-sprites to bitmap, converts fonts from TTF/OTF to WOFF/WOFF2, converts from SCSS/SASS to CSS-style, optimize CSS-styles, merges and minifies CSS-styles, merges and minifies JavaScripts. And also, gives the ability to edit in a live browser.
This is Gulp-template script automatically generates SVG-sprites to bitmap, converts fonts from TTF/OTF to WOFF/WOFF2, converts from SCSS/SASS to CSS-style, optimize CSS-styles, merges and minifies CSS-styles, merges and minifies JavaScripts, compress HTML. And also, gives the ability to edit in a live browser.



Expand Down Expand Up @@ -48,6 +48,7 @@ package.json
└──/images
index.html
index.min.html
```


Expand Down
8 changes: 7 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,20 @@ function html() {
.pipe(filesinclude()) // include templates for gulp
.pipe(minify_inline()) // minifies inline JS and CSS
.pipe(webp_html())
.pipe(htmlmin({
.pipe(dest(path.build.html))
.pipe(htmlmin({ // compressed version of HTML
collapseWhitespace: true,
removeComments: true,
removeCommentsFromCDATA: true,
removeEmptyAttributes: true,
removeEmptyElements: true,
collapseBooleanAttributes: true
}))
.pipe(
rename({
extname: ".min.html"
})
)
.pipe(dest(path.build.html))
.pipe(browsersync.stream()) // update live sync
}
Expand Down

0 comments on commit 2f7aa2c

Please sign in to comment.