简体   繁体   English

使用gulp / gulp-watch-less自动编译更少引导文件不会重新生成CSS

[英]Auto compilation of bootstrap less file with gulp/gulp-watch-less does'nt regenerate the css

I've installed nodejs and gulp to auto compile the bootstrap less file (v 3.3.5) with gulp-watch-less module. 我已经安装了nodejs和gulp以使用gulp-watch-less模块​​自动编译更少引导文件(v 3.3.5)。

Everything is working fine expect one thing: I have to stop and start gulp to regenerate bootstrap.css . 一切正常,请期待一件事:我必须停止并启动gulp以重新生成bootstrap.css

For information, Gulp is detecting that a .less file included in bootstrap.less is modified, I have the following message: 有关信息,Gulp正在检测到bootstrap.less中包含的.less文件被修改,我收到以下消息:

[23:14:40] Starting 'default'...
[23:14:42] Finished 'default' after 2.04 s
[23:16:42] LESS saw variable-overrides.less was changed
[23:16:42] LESS saw variable-overrides.less was changed
[23:16:42] LESS saw bootstrap.less was changed:by:import
[23:16:42] LESS saw bootstrap.less was changed:by:import

But when I open the bootstrap.css file i don't see the changes until I stop and start gulp again. 但是,当我打开bootstrap.css文件时,直到停止并再次启动gulp后,我才能看到更改。

Here is the content of my gulpfile.js : 这是我的gulpfile.js的内容:

var gulp = require('gulp');
var watchLess = require('gulp-watch-less');
var less = require('gulp-less');

gulp.task('default', function () {
    return gulp.src('./../../../../drupal8/sandbox/felicity/themes/octogone/less/bootstrap.less')
        .pipe(watchLess('./../../../../drupal8/sandbox/felicity/themes/octogone/less/bootstrap.less'))
        .pipe(less())
        .pipe(gulp.dest('./../../../../drupal8/sandbox/felicity/themes/octogone/css'));
});

This code is from gulp-watch-less page 这段代码来自无人看管的页面

Can some one explain me why the bootstrap.css is not auto-re-generated? 有人可以解释一下为什么bootstrap.css无法自动重新生成吗?

I've solved the problem by using gulp-watch-less2 我已经通过使用gulp-watch-less2解决了这个问题

Gulp-watch-less wasn't compatible with gulp 3.9 无需Gulp监视的手表与gulp 3.9不兼容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM