gulp-less

Import .css file in Less using nodejs gulp

别说谁变了你拦得住时间么 提交于 2019-12-04 03:26:19
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? 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 the file as a Less file, no matter what the file extension css: treat the file as a CSS file, no matter what

Incremental gulp less build

岁酱吖の 提交于 2019-12-02 20:54:22
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 unsuccessful tries I ended up with following code (tested with the latest bootstrap distribution): var

Gulp css styles are not updated

做~自己de王妃 提交于 2019-12-02 17:54:22
问题 I have problem. Yestrday I had to update the Node.js kernel and now that I change something in the LESS file, there will be no css update. Gulpfile is the same as before the update. Could someone advise me what's wrong with my gulpfile script? The HTML file update is OK. //*********** IMPORTS ***************** var gulp = require('gulp'), browserSync = require('browser-sync'); var postcss = require('gulp-postcss'); var less = require('gulp-less'); var watch = require('gulp-watch'); var

Gulp wouldn't watch any changes

自古美人都是妖i 提交于 2019-12-02 14:29:35
问题 I am scratching my head around but can't seem to figure out whats wrong with the following gulpfile which simply watch and compile less file. This simply won't watch less changes, I have tried all gulp , gulp watch . I have to manually run gulp after each change to compile them. Is there something wrong that causing watch to not work as expected? Gulp Version CLI version 1.4.0 Local version 3.9.1 NPM 4.1.2 Node v7.7.2 var gulp = require('gulp'); var less = require('gulp-less'); // gulp

Gulp wouldn't watch any changes

冷暖自知 提交于 2019-12-02 12:36:59
I am scratching my head around but can't seem to figure out whats wrong with the following gulpfile which simply watch and compile less file. This simply won't watch less changes, I have tried all gulp , gulp watch . I have to manually run gulp after each change to compile them. Is there something wrong that causing watch to not work as expected? Gulp Version CLI version 1.4.0 Local version 3.9.1 NPM 4.1.2 Node v7.7.2 var gulp = require('gulp'); var less = require('gulp-less'); // gulp compile paths var paths = { dist: 'assets/dist' }; gulp.task('css', function() { return gulp.src('assets/less

Gulp css styles are not updated

女生的网名这么多〃 提交于 2019-12-02 07:44:53
I have problem. Yestrday I had to update the Node.js kernel and now that I change something in the LESS file, there will be no css update. Gulpfile is the same as before the update. Could someone advise me what's wrong with my gulpfile script? The HTML file update is OK. //*********** IMPORTS ***************** var gulp = require('gulp'), browserSync = require('browser-sync'); var postcss = require('gulp-postcss'); var less = require('gulp-less'); var watch = require('gulp-watch'); var livereload = require('gulp-livereload'); var autoprefixer = require('gulp-autoprefixer'); var concat = require

Gulp less not handling includes properly, included variables not defined

不想你离开。 提交于 2019-11-30 11:55:32
问题 I am using less and Grunt, and am moving to gulp. My less works. When I run: lessc public/less/myapp.less I get working output with no errors. All my less, including includes, is in public/less , BTW. Here is my gulpfile: var gulp = require('gulp'); var prefixer = require('gulp-autoprefixer'); var less = require('gulp-less'); gulp.task('compileLess', function () { gulp .src('./public/less/*') .pipe(less({ paths: ['./public/less'], // Search paths for imports filename: 'myapp.less' })) .pipe

Gulp less not handling includes properly, included variables not defined

守給你的承諾、 提交于 2019-11-30 01:41:02
I am using less and Grunt, and am moving to gulp. My less works. When I run: lessc public/less/myapp.less I get working output with no errors. All my less, including includes, is in public/less , BTW. Here is my gulpfile: var gulp = require('gulp'); var prefixer = require('gulp-autoprefixer'); var less = require('gulp-less'); gulp.task('compileLess', function () { gulp .src('./public/less/*') .pipe(less({ paths: ['./public/less'], // Search paths for imports filename: 'myapp.less' })) .pipe(gulp.dest('./public/css')); }); // The default task (called when you run `gulp`) gulp.task('default',

Is there a way to rewrite the HTML to use gulp-minified CSS

ⅰ亾dé卋堺 提交于 2019-11-29 20:10:25
I'm struggling with the following: My gulpfile.js compiles all .less, minifies it and concattenates all CSS into ./dist/all.min.css Is there a way I can rewrite the HTML file, remove all style tags and only put one style tag into it loading the minified CSS? OverZealous The best way to handle this is to use one of the HTML injectors from the get-go. I'm using gulp-inject to some success so far. Add gulp-inject to your project: npm i --save-dev gulp-inject Assuming that you have a folder layout similar to this: build/ src/ index.html less/ main.less js/ app.js Your HTML should include this

Is there a way to rewrite the HTML to use gulp-minified CSS

二次信任 提交于 2019-11-28 16:00:16
问题 I'm struggling with the following: My gulpfile.js compiles all .less, minifies it and concattenates all CSS into ./dist/all.min.css Is there a way I can rewrite the HTML file, remove all style tags and only put one style tag into it loading the minified CSS? 回答1: The best way to handle this is to use one of the HTML injectors from the get-go. I'm using gulp-inject to some success so far. Add gulp-inject to your project: npm i --save-dev gulp-inject Assuming that you have a folder layout