Search code examples
gulplaravel-elixirgulp-uglify

Task 'default' is not in your gulpfile


I have tried the NPM install and removed the node_modules folder however I am still getting the error when I run gulp etc

Have I missed something out of my file?

var gulp   = require('gulp');
var elixir = require('laravel-elixir');
var uglify = require('gulp-uglify');


    /*
     |--------------------------------------------------------------------------
     | Elixir Asset Management
     |--------------------------------------------------------------------------
     |
     */


    /*
     |--------------------------------------------------------------------------
     | Elixir JS Asset Management
     |--------------------------------------------------------------------------
     |
     */

     elixir.extend('uglify', function(){

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

            gulp.src('public/admin/js/*.js')
                .pipe(uglify())
                .pipe(ext('-min.js'))
                .pipe(gulp.dest('public/admin/js'));
        });
            return this.queueTask('uglify');
     });

Solution

  • In Laravel Elixir the default tasks are:

    gulp watch
    gulp build
    

    Give that a try. Also make sure your node_modules folder contains the laravel-elixir folder.