Answer the question
In order to leave comments, you need to log in
How to properly configure Gulp?
Installed modules gulp, gulp-less in the project folder. *.less files in less folder, *.css - in css
// Gulp
var less = require('gulp-less');
var gulp = require('gulp');
gulp.task('less', function () {
gulp.src('less/*.less')
.pipe(less())
.pipe(gulp.dest('css'));
});
"scripts": {
"build": "npm run gulp-less"
},
Answer the question
In order to leave comments, you need to log in
var gulp = require('gulp'),
less = require('gulp-less'),
gutil = require('gulp-util');
handleError = function(err) {
gutil.log(err);
gutil.beep();
};
gulp.task('less', function() {
gulp.src('./less/*.less')
.pipe(less())
.on('error', handleError)
.pipe(gulp.dest('./css'))
});
gulp.task("watch", function() {
gulp.watch('less/**/*.less', ['less']);
});
gulp.task("build", ['less']);
gulp.task("default", ["build", "watch"]);
gulp
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question