代码拉取完成,页面将自动刷新
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
notify = require('gulp-notify'),
livereload = require('gulp-livereload'),
webserver = require('gulp-webserver');
gulp.task('default', function() {
// 将你的默认的任务代码放在这
gulp.run('sass');
gulp.run('watch');
});
gulp.task('sass', function() {
gulp.src('static/scss/*.scss')
.pipe(sass({ style: 'compressed'/*,outputStyle: 'compressed'*/}))
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(gulp.dest('static/css'))
.pipe(notify({ message: 'Styles task complete' }))
.pipe(livereload());
});
gulp.task('webserver', function(){
gulp.src('./')
.pipe(webserver({
livereload: true,
open: true
}));
});
gulp.task('watch',function(){
livereload.listen();
gulp.watch(['static/scss/*.scss'],['sass']);
gulp.watch(['*.html','static/js/*.js']).on('change', livereload.changed);
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。