0

I am new to gulp and I am wondering what I am doing wrong as it will only create my styles.css file but none of my other css files are being created from the less directory

my gulp file

/* File: gulpfile.js */

// grab our gulp packages
var gulp  = require('gulp'),
    gutil = require('gulp-util'),
    less  = require('gulp-less');

// create a default task and just log a message
gulp.task('default', function() {
  return gutil.log('Gulp is running!')
});

gulp.task('build-css', function() {
  return gulp.src('source/less/*.less')
    .pipe(less())
    .pipe(gulp.dest('public/assets/styles'));
});


gulp.task('watch', function() {
  gulp.watch('source/less/**/*.less', ['build-css']);
});

Reference to css in my index file

File structure

enter image description here

also in my styles.less file I have @import 'source/less/mixins.less';

webdevgirl
  • 23
  • 4

1 Answers1

0

can you try like this...

/* File: gulpfile.js */

// grab our gulp packages
var gulp  = require('gulp'),
    gutil = require('gulp-util'),
    less  = require('gulp-less');    

gulp.task('build-css', function() {
  return gulp.src('source/less/*.less')
    .pipe(less())
    .pipe(gulp.dest('public/assets/styles'));
});

gulp.task('watch', function() {
  gulp.watch('source/less/**/*.less', ['build-css']);
});

// create a default task and just log a message
gulp.task('default',['watch','build-css'], function() {
  return gutil.log('Gulp is running!')
});
roshini
  • 112
  • 7