标签:
https://github.com/superhighfives/harp-gulp-browsersync-boilerplate
https://gist.github.com/geelen/a5fcb013de67f680cb8d
gulp配置
var gulp = require(‘gulp‘);
var browserSync = require(‘browser-sync‘);
var reload = browserSync.reload;
var harp = require(‘harp‘);
/**
* Serve the Harp Site from the src directory
*/
gulp.task(‘serve‘, function () {
harp.server(__dirname + ‘/app‘, {
port: 9000
}, function () {
browserSync({
proxy: "localhost:9000",
open: false,
/* Hide the notification. It gets annoying */
notify: {
styles: [‘opacity: 0‘, ‘position: absolute‘]
}
});
/**
* Watch for scss changes, tell BrowserSync to refresh main.css
*/
gulp.watch("app/**/*.scss", function () {
reload("main.css", {stream: true});
});
/**
* Watch for all other changes, reload the whole page
*/
gulp.watch(["./*.js","./app/*.ejs", "./app/js/*.js",‘./app/partials/*.ejs‘,‘./app/*.json‘], function () {
reload();
});
})
});
/**
* Default task, running just `gulp` will compile the sass,
* compile the harp site, launch BrowserSync & watch files.
*/
gulp.task(‘default‘, [‘serve‘]);
标签:
原文地址:http://www.cnblogs.com/lihuazhidao/p/5411612.html