Jcook894 Jcook894 - 1 year ago 120
Javascript Question

Gulp uglify running but not working

I set up my gulp task to minify js, But when I run gulp through the command line it runs but nothing is added to the file.

var gulp = require('gulp');
var uglify = require('uglify-js');

gulp.task('minifyjs', function(){

return gulp.src('views/js/*.js');


Answer Source

This will work if you're running your Gulp task in such a project structure:

|_ Views
|   |_ JS
|       |_a.js
|_ gulpfile.js

Even in this case, try and make the folder './views/js/*.js', or '/views/js/*.js'