Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the compressHTML task #41

Open
wants to merge 6 commits into
base: the-compress-html-task
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
/*jslint node: true */

var gulp = require('gulp');
const { src, dest }= require('gulp');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go ahead and change the inch marks to back ticks

const htmlCompressor = require('gulp-htmlmin');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, regarding the back ticks


gulp.task('compressHTML', function () {
'use strict';
let compressHTML = () => {
return src([`dev/html/*.html`,`dev/html/**/*.html`])
.pipe(htmlCompressor({collapseWhitespace: true}))
.pipe(dest(`prod`));
};

var htmlMinifier = require('gulp-htmlmin');

return gulp.src(['dev/html/*.html', 'dev/html/**/*.html'])
.pipe(htmlMinifier({
removeComments: true,
collapseWhitespace: true
}))
.pipe(gulp.dest('prod'));
});
exports.compressHTML = compressHTML;
Loading