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/,如下
时间: 2024-11-03 03:28:33