F:\newpagebao\happybao\stc (master) λ gulp serve [15:02:21] Working directory changed to F:\newpagebao [15:02:22] Using gulpfile F:\newpagebao\gulpfile.js [15:02:22] Starting 'sass'... [15:02:22] error happybao/stc/scss/idx.scss (Line 1: File to import not found or unreadable: compass/reset.) [15:02:22] Finished 'sass' after 455 ms [15:02:22] Starting 'serve'... [15:02:22] Finished 'serve' after 43 ms [BS] Access URLs: ------------------------------------- Local: http://localhost:3000 External: http://192.168.1.14:3000 ------------------------------------- UI: http://localhost:3001 UI External: http://192.168.1.14:3001 ------------------------------------- [BS] Serving files from: ./happybao/stc
gulpfile-settings:
var minifycss = require('gulp-minify-css'),// CSS压缩 uglify = require('gulp-uglify'),// js压缩 concat = require('gulp-concat'),// 合并文件 rename = require('gulp-rename'),// 重命名 clean = require('gulp-clean');//清空文件夹 var gulp = require('gulp'), sass = require('gulp-ruby-sass'), sourcemaps = require('gulp-sourcemaps'), filter = require('gulp-filter'); notify = require('gulp-notify'), plumber = require('gulp-plumber'); browserSync = require('browser-sync').create(), reload = browserSync.reload; gulp.task('serve', ['sass'], function() { browserSync.init({ server: "./happybao/stc" }); gulp.watch("happybao/**/*.scss", ['sass']); gulp.watch("happybao/**/*.html").on('change', reload); }); gulp.task('sass', function() { return sass(['happybao/stc/scss/*.scss','!happybao/stc/scss/extend/{reset,test}.scss'],{sourcemap:true}) //.pipe(sourcemaps.init()) .on('error',function(err) { notify().write(err); this.emit('end'); }) .pipe(sourcemaps.write('../maps')) .pipe(gulp.dest('happybao/stc/css'))// Write the CSS & Source maps .pipe(filter('happybao/**/*.css')) // Filtering stream to only css files .pipe(reload({stream: true}));//必须要 }); gulp.task('default', ['serve']);
compass
装了么?还有你用的是
gulp-sass
还是什么东西在做这件事?这个问题最好还是从使用的插件着手