Reputation: 3829
I am trying to create all.js
file from all .js
files in one folder with the help of gulp. But i am not getting all.js
file.
Steps i have followed as follows:
File: gulpfile.js
// grab our gulp packages
var gulp = require('gulp'),
gutil = require('gulp-util'),
concat = require('gulp-concat-util');
// create a default task and just log a message
gulp.task('default', function() {
return gutil.log('Gulp is running!')
});
gulp.task('scripts', function() {
gulp.src(['./js/*.js'])
.pipe(concat.scripts('all.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist/'))
});
gulp
command. After running gulp, i am getting message as Gulp is running
as mentioned in file. But Js file is not created.
Any help shall be appreciated.
Upvotes: 1
Views: 1121
Reputation: 55613
You're not running the task. You need to run the command gulp scripts
Gulp is a task runner. It allows you to specify tasks
. The default
task is run when you run the gulp
command. If you want to run a task other than the default
task you must
gulp {{taskname}}
where {{taskname}}
is callback called via gulp.task
in your gulpfile
or default
task.You haven't done either. So when you run gulp
from the command line, all you are running is the default
task, which does nothing except call gutil.log
and then return.
Upvotes: 1