gulp-less

Gulp only compiles LESS the first time I run it. It still sees my changes but doesn't update the compiled CSS file

夙愿已清 提交于 2020-01-16 13:23:39
问题 I'm a little new with gulp. I have an old Wordpress theme which I'm trying to use gulp with to compile the LESS files. My structure is like this: -theme --library ---less ----style.less (all the imports all of the less files) ----brew (all the less files are in this folder) ---css ----style.css (this is the compiled css file) -gulp-dev --node_modules --gulpfile.js --package.json And here is my gulpfile: var gulp = require('gulp'); var less = require('gulp-less'); var browserSync = require(

Incremental gulp less build

戏子无情 提交于 2019-12-31 10:42:32
问题 In my office we are using gulp to build our less files. I wanted to improve the build task as it took over a second to build on a large project we recently worked on. The idea was to cache the files and only pass the one that changed. So I started with google and found incremental builds for javascript ang thought it would be easy to rewrite them for less. Here's the one I started with: https://github.com/gulpjs/gulp/blob/master/docs/recipes/incremental-builds-with-concatenate.md After a few

Incremental gulp less build

↘锁芯ラ 提交于 2019-12-31 10:42:05
问题 In my office we are using gulp to build our less files. I wanted to improve the build task as it took over a second to build on a large project we recently worked on. The idea was to cache the files and only pass the one that changed. So I started with google and found incremental builds for javascript ang thought it would be easy to rewrite them for less. Here's the one I started with: https://github.com/gulpjs/gulp/blob/master/docs/recipes/incremental-builds-with-concatenate.md After a few

Import .css file in Less using nodejs gulp

一世执手 提交于 2019-12-21 10:10:15
问题 According to this question it's possible to import css file from less v.1.4.0. I tried to use gulp-less task, and it's not working. There's any way to import css file like this: @import "../spritesheet.css"; with nodeJS gulp? 回答1: There are several ways to include files in LESS, depending on what you need, using @import ([keyword]) "filename" . Allowed keywords are: reference: use a Less file but do not output it inline: include the source file in the output but do not process it less: treat

gulp-watch in combination with gulp-less caching issue

孤街浪徒 提交于 2019-12-17 21:16:09
问题 I have the following setup: // watch for changes gulp.task('watch', function () { gulp.watch('./assets/**/*.less', ['compile-less']); }); gulp.task("compile-less", () => { return gulp.src('./assets/build-packages/*.less') .pipe($.less({ paths: [ $.path.join(__dirname, 'less', 'includes') ] })) .pipe(gulp.dest(OutputPath)); // ./dist/styles/ }); So basically every time a developer changes something in a less file it runs the task 'compile-less'. The task 'compile-less' builds our package less

Laravel Elixir Gulp mix two separate less files

与世无争的帅哥 提交于 2019-12-11 10:55:38
问题 In Laravel 5 I am trying to create two different css files for my frontend site and backend site (cms). The source files are in two different directories. The default value for assets in first the backend elixir.config.assetsDir = 'resources/backend/'; elixir(function (mix) { mix.less('backend.less'); }); Second the frontend elixir.config.assetsDir = 'resources/frontend/'; elixir(function (mix) { mix.less('frontend.less'); }); Both are in the same gulpfile.js. These are the directories

Starting Gulp with Gulp-less maintain folder structure

泪湿孤枕 提交于 2019-12-11 08:23:55
问题 I've today started to look at gulp.js to compile my less files etc. I've got it up and running with a task but the compiled files are all placed in the same folder - not maintaining the source hierarchy. Is there a way to ensure that the output maintains the original file structure? I'm new to gulp so may not be doing this correctly. Here is my gulp file (the part relating to Less): var sourceLess = 'app/assets/stylesheets/less'; var targetCss = 'public/css2'; // Compile Our Less gulp.task(

Path to source map is wrong

情到浓时终转凉″ 提交于 2019-12-06 08:35:23
问题 I use the packages gulp-less and gulp-sourcemaps . My less file is located under Styles/main.less , but the generated source map points to source/main.less (where source/ seems to be a prefix). How to fix this, so the source map correctly points to source/Styles/main.less ? My gulp task is rather simple: var gulp = require('gulp'), less = require('gulp-less'), gulpif = require('gulp-if'), sourcemaps = require('gulp-sourcemaps'); var paths = { styles: [ 'Styles/**/*.less', '!**/*.min.css' ],

Gulp.js stops compiling LESS when watched after there has been an error in the LESS files

半腔热情 提交于 2019-12-04 10:44:39
问题 I'm having a problem with gulp . I run gulp-watch along with gulp-less and gulp-clean . Everything is running perfectly. When I edit somefile.less and I save it with a semi-colon missing or maybe I accidentally leave a trailing ;s , just have errors in my code when saving, gulp-less logs an error in the console. After I fix it gulp-watch continues watching the files, but gulp-less doesn't fire and it doesn't compile. When I stop gulp and run it again in the terminal everything goes back to

Gulp watch and compile less files with @import

放肆的年华 提交于 2019-12-04 09:00:46
问题 I'm trying to get my head around gulp to watch and compile a .less project + livereload. I have a style.less file which use @import . When i run the gulp task it doesn't seem to understand the imports. When I modify the main less file, gulp compiles the file and refresh the browser but if i modify only an import, the changes are ignored. Here is my gulpfile.js var gulp = require('gulp'); var less = require('gulp-less'); var watch = require('gulp-watch'); var prefix = require('gulp