0

I used for the js file but it didn't work. I used same scenario for the minimize css file. It works properly. How can I overcome that problem?

gulp.task('buildApp',['copyAll'],function(){ //concatenate js files to buildApp
    return gulp.src(paths.js)
        .pipe(depsOrder())
        .pipe(concat('app.js'))
        .pipe(uglify())
        .pipe(rename('app.min.js'))
        .pipe(gulp.dest(paths.buildAppconcat))

});
4
  • 1
    Any error message? What output do you get in your destination directory? Commented Nov 12, 2015 at 9:21
  • did n't show any error message.Case it did n't show min js version.It shown existing full code with out minimizing Commented Nov 12, 2015 at 9:24
  • 1
    import gulp-util as gutil gutil = require 'gulp-util' and add an error handler .on 'error', gutil.log Commented Nov 12, 2015 at 9:28
  • 1
    Did you try to output the concatenated file before uglifying it? Commented Nov 12, 2015 at 9:31

1 Answer 1

2

It's seems that you want to save two files app.js and app.min.js. For this scenario you could do the following:

gulp.task('buildApp',['copyAll'],function(){ //concatenate js files to buildApp
return gulp.src(paths.js)
    .pipe(depsOrder())
    .pipe(concat('app.js'))
    .pipe(gulp.dest(paths.buildAppconcat))
    .pipe(rename('app.min.js'))
    .pipe(uglify())
    .pipe(gulp.dest(paths.buildAppconcat))

});
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.