javascript - How to use gulp-defer in gulp task? -
i having issue javascript loaded before page contents loaded decided use gulp-defer package in gulptask.
here code
// including plugins var gulp = require('gulp') defer = require("gulp-defer"); // task gulp.task('concat', function () { gulp.src('./javascript/*.js') // path files .pipe(concat('concat.js')) // concat , name "concat.js" .pipe(gulp.dest('./dest')); }); gulp.task('html:release', function() { return gulp.src('./index.html') .pipe(defer()) //defer method called .pipe(gulp.dest('./dest')); });
i referred gulp-defer package.actually cant able understand how processed.please 1 explain how defer works in gulp task. in advance!!
not sure asking documentation self-explained:
moves render blocking javascript , css deferred loading section.
it helpful if "eliminate render-blocking javascript , css in above-the-fold content" warning pagespeed insights results
Comments
Post a Comment