- Q What do you hate about your boss?
- Q A can work three times as B can work. If A takes 60 days less than B to complete the same task, calculate the number of days when both A and B start working together on the same day.
- Q What helps a bean plant grow better?
- Q Why did you choose this career path?
- Q What is quiscent centre?
- Q If we update the view will it automatically update main table?? Also vice versa is possible to update ??
- Q Write Short Essay on RNA isolation
- Q How does Resistance of the metal lines vary with increasing thickness and increasing length?
- Q What is the use of description logic in W3C?
- Q Did you mind the inconvenience faced in our fight to curb corruption, black money, terrorism and counterfeiting of currency?
- Q Who started the Bhoodan Movement?
Answers
Gulp and Grunt, both are JavaScript task runners and both do the same job. Let’s first see some similarities.
Both are JavaScript task runner and automate various things like minification, error checking, compiling SAAS or LESS to css and many more…
Both are using npm for installation and rely on Node.js
Both have plenty of plugins to do the all the job.
Now, where they differ:
Gulp prefers code over configuration approach, which makes thing more efficient and manageable.
Gulp uses node stream to reduce file I/O operations while performing any task, where with Grunt performs more file I/O operations. Which makes gulp fast.
Grunt is synchronous by design. Each task will only run after the last task has finished, in a series. On the other hand, Gulp is asynchronous. So you can’t be sure in which exact order the tasks will be finished.
Grunt plugins do more than one job which complicates things, where gulp plugins are clean to do only one job.
Community support is great for grunt as it’s very old, where for gulp, its not that great in comparison with Grunt.
Grunt has more plugins to work with than gulp.
That’s all folk. If you have something to add in this list, please mention in comments section. Meanwhile, share this in your network and spread this to help others.
Below is a sample gulpfile.js for your reference.
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
// Lint Task
gulp.task('lint', function() {
return gulp.src('js/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// Compile Sass
gulp.task('build-css', function() {
return gulp.src('scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('css'));
});
// Concatenate & Minify JS
gulp.task('scripts', function() {
return gulp.src('js/*.js')
.pipe(concat('all.js'))
.pipe(gulp.dest('dist'))
.pipe(rename('all.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
// Watch Files For Changes
gulp.task('watch', function() {
gulp.watch('js/*.js', ['lint', 'scripts']);
gulp.watch('scss/*.scss', ['build-css']);
});
// Default Task
gulp.task('default', ['lint', 'build-css', 'scripts', 'watch']); Your Comment
Both are JavaScript task runner and automate various things like minification, error checking, compiling SAAS or LESS to css and many more…
Both are using npm for installation and rely on Node.js
Both have plenty of plugins to do the all the job.
Now, where they differ:
Gulp prefers code over configuration approach, which makes thing more efficient and manageable.
Gulp uses node stream to reduce file I/O operations while performing any task, where with Grunt performs more file I/O operations. Which makes gulp fast.
Grunt is synchronous by design. Each task will only run after the last task has finished, in a series. On the other hand, Gulp is asynchronous. So you can’t be sure in which exact order the tasks will be finished.
Grunt plugins do more than one job which complicates things, where gulp plugins are clean to do only one job.
Community support is great for grunt as it’s very old, where for gulp, its not that great in comparison with Grunt.
Grunt has more plugins to work with than gulp.
That’s all folk. If you have something to add in this list, please mention in comments section. Meanwhile, share this in your network and spread this to help others.
Below is a sample gulpfile.js for your reference.
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
// Lint Task
gulp.task('lint', function() {
return gulp.src('js/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// Compile Sass
gulp.task('build-css', function() {
return gulp.src('scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('css'));
});
// Concatenate & Minify JS
gulp.task('scripts', function() {
return gulp.src('js/*.js')
.pipe(concat('all.js'))
.pipe(gulp.dest('dist'))
.pipe(rename('all.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
// Watch Files For Changes
gulp.task('watch', function() {
gulp.watch('js/*.js', ['lint', 'scripts']);
gulp.watch('scss/*.scss', ['build-css']);
});
// Default Task
gulp.task('default', ['lint', 'build-css', 'scripts', 'watch']); Your Comment
- 0
- 0
- New Answer
- Contributors: *,
More Software Questions..
What is the inputsplit in map reduce software?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
What is software configuration management?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
What Is Java Api For Xml-based Rpc (jax-rpc)?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
How can you implement fine-grained auditing?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
What is IBM’s simple explanation for Big Data’s four critical features?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
What is static synchronized method in JDBC API? Give an example?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
What does the NULLIF function do?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
What happens if a start method is not invoked and the run method is directly invoked?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
Should we override finalize method
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
what is the difference between mysql_fetch_array and mysql_fetch_object?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
How will XML affect my document links?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
Why to use Style Sheets?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
What are Filters in MVC?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
Can you explain Application layer in OSI model?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
How to define new testplan attributes?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
What are the minimum system requirements to run Photoshop? Is it possible to run Photoshop over linux?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
Which oracle package is used to manage the oracle lock management services?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you avoid Latch Up?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
What is marker interface?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,
What types of partitioning are there for BW?
- 0
- 0 |
- |
- Post Answer |
- Answers ( 1 )
- Tags: Software,