Gulp CSS样式未更新 [英] Gulp css styles are not updated

查看:115
本文介绍了Gulp CSS样式未更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题.昨天,我不得不更新Node.js内核,现在我更改了LESS文件中的内容,因此不会进行css更新. Gulpfile与更新之前的相同.有人可以告诉我我的gulpfile脚本出了什么问题吗?

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?

HTML文件更新正常.

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-concat-css');
var cssmin = require('gulp-cssmin');


/* BROWSERSYNC */
gulp.task('browserSync', function () {
    var files = ['orient-spa/**'];

    browserSync.init(files, {
       server: {
          baseDir: 'orient-spa/',
          index: 'index.html'
       },
       logPrefix: 'OS01', 
       browser: ['chrome']
    });
});

gulp.task('css', function () {
    var processors = [
        autoprefixer
    ];
    return gulp.src('./orient-spa/skins/less/index-files.less')
    .pipe(less())
    .pipe(postcss(processors))
    .pipe(gulp.dest('./orient-spa/skins/css/'))
    .pipe(livereload());
});

gulp.task('watch', function() {
    livereload.listen();
    gulp.watch('./orient-spa/skins/less/*.less', ['css']);
    gulp.watch('./orient-spa/skins/css/*.css', ['concatMinify']);
});

gulp.task('concatMinify', function () {
    return gulp.src('./orient-spa/skins/css/*.css')
    .pipe(concat("index.css"))
    .pipe(cssmin())
    .pipe(gulp.dest('./orient-spa/skins/css/compiled'))
    .pipe(livereload());
});

gulp.task('default', ['browserSync', 'watch', 'css', 'concatMinify']);

感谢您的建议:-)

推荐答案

我尝试使用此路径,但问题仍然存在.

I try this path, but problem remains.

最新版本的node.js是Node.js 7.2.1( Node.js ),现在是Node.js 9.8.0.

Last version node.js was Node.js 7.2.1 (Node.js), now Node.js 9.8.0.

在LESS文件中更改1行后,我将图像附加到控制台.

I attach an image to the console after changing 1 line in the LESS file.

在这里,我看到命令集未正确调用.或者它们被反复调用.请问您在这里看不到错误吗?

Here I see that the set of commands does not call correctly. Or they are called repeatedly. Do not you see a mistake here, please?

感谢您的建议

这篇关于Gulp CSS样式未更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆