Giter VIP home page Giter VIP logo

gulp-template's Introduction

Gulp模板(未完善)

包含功能:

开发:

  • babel编译
  • sass编译
  • eslint检查
  • browserSync

生产:

  • js合并
  • css合并
  • eslint检查
  • 图片压缩
  • 版本控制

流程介绍:

在开发当中将es6以及sass文件编译成浏览器可识别的js以及css文件,并保存在临时目录 tmpRelease 中,在index.html引用临时目录的文件.

    <link rel="stylesheet" href="./tmpRelease/css/global.css">
    <link rel="stylesheet" href="./tmpRelease/css/csa.css">
    <script src='./tmpRelease/js/index.js'></script>
    <script src='./tmpRelease/js/test.js'></script>

由于开发当中使用的是增量编译,所以对于eslint只会对修改过得文件生效.

但会在第一次启动gulp进行全局eslint检查,后续只会对增量的文件进行检查.

eslint规则目前只提供样例,最终应按照其他小组所规定的规则

对于browserSync,目前对于css/sass文件修改可通过注入刷新,但对于js和html修改只能全局刷新.


通过调用createSassTaskcreateBabelTask 生成任务

// 创建sass预处理任务
createSassTask({
    taskName: 'sass',
    src: sassFile,
    dest: sassRelease
        // isConcat: true,
        // concatName: 'test.css'
});
// 创建js预处理任务
createBabelTask({
    taskName: 'babel',
    src: esFile,
    dest: esRelease
});

gulp-template's People

Contributors

zwingz avatar

Watchers

 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.