0

I'm a Gulp JS beginner. Currently I'm trying to compile some simple less code to CSS. My Gulp task should output a new CSS file for this but after I run the task, nothing happens. I've included the gulp-util module to try to debug the task execution but it doesn't show me any errors.

Here's my Gulp file:

// gulpfile.js

// --- INIT
var gulp = require('gulp'),
    util = require('gulp-util'),
    less = require('gulp-less'), // compiles less to CSS
    minify = require('gulp-minify-css'), // minifies CSS
    concat = require('gulp-concat'),
    rename = require('gulp-rename'),
    uglify = require('gulp-uglify'); // minifies JS

// Paths variables
var paths = {
    'dev': {
        'less': './laravel/public/assets/less/'
    },
    'assets': {
        'css': './laravel/public/assets/css/ ',
        'js': './laravel/public/assets/js/',
        'vendor': './laravel/public/assets/bower_vendor/'
    }

};

// --- TASKS

// Auth CSS
gulp.task('auth.css', function(){
   return gulp.src(paths.dev.less + 'auth.less')
       .pipe(less().on('error', util.log))
       .pipe(gulp.dest(paths.assets.css))
       .pipe(minify({keepSpecialComments:0}))
       .pipe(rename({suffix: '.min'}))
       .pipe(gulp.dest(paths.assets.css));
});

// --- WATCH

// --- DEFAULT
gulp.task('default', ['auth.css']);

I'm using Laravel 4. This file lives in the root directory. I have changed the paths but that doesn't seem to work either. Any ideas?

2 Answers 2

1

Try removing the extra space at the end of your path.assets.css.

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

2 Comments

Thanks for answering. I just discovered the problem. I removed "./laravel" from the path, now it works.
No problem, glad its sorted.
0

Just fixed. It seems, the path had to be something like: "./public/assets/css/". Now the file has been generated.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.