我正在使用gulpfile.js来编译开发。我想从网址中删除端口号,因为我的网址正在查看mywebsite.dev:8080
gulpfile.js代码如下:
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
gulp.task('sass', function() {
return gulp.src(['src/scss/*.scss'])
.pipe(sass())
.pipe(gulp.dest("src/css"))
.pipe(browserSync.stream());
});
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: "./src",
open: 'external',
host: 'mywebsite.dev',
port: 8080
});
gulp.watch(['src/scss/*.scss'], ['sass']);
gulp.watch("src/*.html").on('change', browserSync.reload);
});
gulp.task('default', ['serve']);