Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.72 KB

README.md

File metadata and controls

38 lines (28 loc) · 1.72 KB

gulp使用

gulp: stream building tools.

  1. npm run gulp图片压缩
  2. npm run gulpWatchwatch图片压缩
  3. npm run gulpWebp图片转成webp
  1. Node.js' package for gulp(local): package.json
    1. npm run gulp

    2. npm run gulp -- browserSync

      BrowserSync利用WebSocket,当监控的文件MD5发生变化时,向客户端发送刷新页面指令。

    3. npm run gulp -- delRelease

    4. npm run gulp -- watch

    1. By using gulp first time, error always occurred because of the bad network when we installed plug-ins.
    2. Some plug-ins depend on fsevents which is only for macOS will fail when installed by cnpm 😢. Try nrm to change registry then use npm.
    3. If shit happened, we should have to uninstall then install the problem plug-ins.
  2. Gulp settings for tasks: gulpfile.js

    BrowserSync is working with AJAX. Blocking AJAX will stop browserSync, such as Mock.js.

  3. Do not watch too many files(such as node_modules folder), to avoid checking too many files so that the watch task will take huge time.

  4. .eslintrc.js is for ESLint.

  5. .babelrc is for Babel.

  6. .editorconfig is for IDEs' editor.

  7. Handlebars settings for spritesmith

    1. pc.handlebars
    2. wap.handlebars

When install error occurs, please try cnpm or yarn.