gulp-connect作用:建立一个webserver
gulpfile.js如下
var gulp = require('gulp'), connect = require('gulp-connect'); gulp.task('dev', function() { connect.server({ port: 8000, livereload: true }); });
效果:
命令行运行命令 gulp dev,浏览器访问 http://localhost:8000/,如下