1

好的,所以以前在差异计算机上一切正常,切换后我最终不得不再次安装所有东西。现在我通读了安装 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

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

4

0 回答 0