首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在IIS中使用gulp-connect

如何在IIS中使用gulp-connect
EN

Stack Overflow用户
提问于 2016-12-17 01:14:22
回答 1查看 210关注 0票数 1

当我在我的前端改变一些东西时,我正在使用库gulp-connect来刷新我的浏览器。但正如您所知道的,它在localhost:8080这样的服务器上工作...问题是我的后端在IIS中,我想知道当我在localhost:80 (IIS)中更改它时,是否有某种方法可以将我的IIS连接到gulp-connet来刷新我的代码?也许是一个中间件或类似的东西?

EN

回答 1

Stack Overflow用户

发布于 2018-10-12 14:53:37

你最好使用browsersync:

代码语言:javascript
复制
//Set up the proxy
const browserSyncStart = () => { browserSync.init({ proxy: 'localhost' }); };

//set up a watch
const watcher = () => { return gulp.watch(src).on('all', () => { compileLess().on('end', publish); }); };

//Let the publish function also reload the browser
export const publish = () => {
  // Check if the folder exists
  if (fs.existsSync(config.publishPath)) {
    //copy from /dist to /wwwroot
    del(config.publishPath + 'dist/**/*', { force: true });
    gulp.src(config.theming.dist + '/**/*').pipe(gulp.dest(config.publishPath + 'dist'));
    browserSync.reload();
  } else {
    log(c.red(config.publishPath + ' does not exist.'));
  }
};

//Create a task, run with gulp watch
export const watch = gulp.parallel(browserSyncStart, watcher);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41189314

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档