GithubHelp home page GithubHelp logo

chwj / browser-sync-via-gulp Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 175 KB

使用gulp复制文件到部署目录,并启用browser-sync重载HTML/CSS/JS资源

License: MIT License

JavaScript 100.00%
gulp4 nodejs browser-sync

browser-sync-via-gulp's Introduction

browser-sync-via-gulp

使用 gulp 复制文件到部署目录,并启用 browser-sync 重载HTML/CSS/JS资源

已具备功能

  • 当文件变化时复制到部署目录
  • 如果变化的文件其类型是 CSS 文件,则自动重载
  • 如果变化的文件其类型是 HTML 文件,则自动重载
  • 如果变化的文件其类型是 JS 文件,则自动重载

依赖

  • browser-sync: 2.26.7
  • gulp: 4.0.2

配置与启动

  1. gulpfile.js
    • htmlFilescssFilesjsFiles 配置为对应glob
    • exisitStrreplaceStr 配置为对应路径
    • 26 行配置为代理网址;第 27 行配置为代理端口
  2. 在根目录下用命令行执行 gulp start

运行截图

截图

参考资料

browser-sync-via-gulp's People

Contributors

chwj avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.