I am having the issue the javascript is loaded before the page contents are loaded so decided to use the gulp-defer package in my gulptask.
Here is the code
// including plugins
var gulp = require('gulp')
defer = require("gulp-defer");
// task
gulp.task('concat', function () {
gulp.src('./javascript/*.js') // path to your files
.pipe(concat('concat.js')) // concat and name it "concat.js"
.pipe(gulp.dest('./dest'));
});
gulp.task('html:release', function() {
return gulp.src('./index.html')
.pipe(defer()) //defer method is called
.pipe(gulp.dest('./dest'));
});
I referred this from gulp-defer package.actually I cant able to understand how it is processed.Please any one explain how is the defer works in gulp task. Thanks in advance!!