我是gulp的新手,我想知道我做错了什么,因为它只会创建我的styles.css文件,但是我的其他css文件都没有从less目录中创建
我的gulp文件
/* 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']);
});

在我的索引文件中引用css
文件结构
也在我的styles.less文件中 我有@import&source; / less / mixins.less&#39 ;;
答案 0 :(得分:0)
/* 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!')
});