browser-sync被淘汰了吗
1个回答
2016-10-22 · 知道合伙人互联网行家
关注
展开全部
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
rename = require('gulp-rename'),
notify = require('gulp-notify');
var browserSync = require('browser-sync').create();
gulp.task('sass', function() {
return sass('sass/style.scss', {style: "expanded"})
//.pipe(sass({style: "expanded"}))
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(rename({suffix: '.min'}))
.pipe(minifycss())
.pipe(gulp.dest('css'))
.pipe(notify({ message: 'Styles task complete' }))
.pipe(browserSync.stream());
});
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: "./"
});
gulp.watch("sass/*.scss", ['sass']);
gulp.watch("*.html").on('change', browserSync.reload);
});
gulp.task('default', ['serve']);
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
rename = require('gulp-rename'),
notify = require('gulp-notify');
var browserSync = require('browser-sync').create();
gulp.task('sass', function() {
return sass('sass/style.scss', {style: "expanded"})
//.pipe(sass({style: "expanded"}))
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(rename({suffix: '.min'}))
.pipe(minifycss())
.pipe(gulp.dest('css'))
.pipe(notify({ message: 'Styles task complete' }))
.pipe(browserSync.stream());
});
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: "./"
});
gulp.watch("sass/*.scss", ['sass']);
gulp.watch("*.html").on('change', browserSync.reload);
});
gulp.task('default', ['serve']);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询