gulp没有处理sass来纠正目录

时间:2015-12-06 01:03:15

标签: javascript gulp gulp-watch gulp-ruby-sass

好吧所以一切都习惯在差异计算机上工作得很好,切换后我最终还是要再安装一切。现在我通读教程安装gulp并且它实际上与javascript文件一起工作但是由于一些奇怪的原因我的sass编译在一个奇怪的输出中并且实际上文件不存在..所以不确定我在这里做错了什么。



var gulp = require('gulp'),
    sass = require('gulp-ruby-sass'),
    minifycss = require('gulp-minify-css'),
    uglify = require('gulp-uglify'),
    rename = require('gulp-rename'),
    concat = require('gulp-concat'),
    notify = require('gulp-notify'),
    autoprefixer = require('gulp-autoprefixer'),
    del = require('del');

gulp.task('styles', function(){
    return sass('public/sass/')
        .pipe( autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
        .pipe( minifycss() )
        .pipe( gulp.dest('public/css/'))
        .pipe( notify({message: '¡Styles complete!'}));
});

gulp.task('scripts', function(){

    var files = [
        'public/js-source/vendor/jquery.min.js',
        'public/js-source/vendor/modernizr.custom.js',
        'public/js-source/vendor/bootstrap.min.js',
        'public/js-source/vendor/bootstrap-modal.js',
        'public/js-source/vendor/bootstrap-modalmanager.js',
        'public/js-source/vendor/bootstrap-slider.js',
        'public/js-source/vendor/bootstrap-toggle.min.js',
        'public/js-source/vendor/date.js',
        'public/js-source/vendor/datepicker.js'


    ];

    gulp.src( files )
        .pipe( concat('concat.js') )
        .pipe( gulp.dest('public/js/'))
        .pipe( uglify() )
        .pipe( rename('concat.min.js') )
        .pipe( gulp.dest('public/js/'))
        .pipe( notify({message: '¡Scripts complete!'}));

});

gulp.task('default', ['styles']);

gulp.task('watch', function(){
    gulp.watch('public/sass/**/*.scss', ['styles']);
    gulp.watch('public/js-source/**/*.js', ['scripts']);
});




当我修改任何scss文件以测试输出时,它会执行以下操作:

[19:48:59] write ./.css/bootstrap.css
[19:49:02] write ./.css/landing.css
[19:49:07] write ./.css/style.css

所以我完全不知道它是什么......

0 个答案:

没有答案