Giter VIP home page Giter VIP logo

gulp-tasks's Introduction

Amaze UI Gulp Tasks


NPM version

Dependency Status devDependency Status

Amaze UI 插件开发 gulp 任务。

安装及使用

$ npm i amazeui-gulp-tasks --save-dev

gulpfile.js 中调用任务:

// gulpfile.js

'use strict';

var gulp = require('gulp');
var tasks = require('amazeui-gulp-tasks');
var runSequence = require('run-sequence');

var config = {
  // 任务配置
};

tasks(gulp, config);

gulp.task('build', function(cb) {
  runSequence('clean', ['uglify', 'browserify', 'less', 'markdown'], cb);
});

gulp.task('dev', ['build', 'server']);

任务及配置说明

less

编译 Less。配置如下:

var config = {
  less: {
    src: '', // 源文件
    autoPrefixer: {}, // autoprefixer 设置,
    dist: '', // 部署目录
    watches: '', // watch 的文件,如果不设置则 watch `src` 里的文件
    banner: '' // 是否添加 banner,布尔值或者 {template: '', data: {}}
  }
}

browserify

使用 Browserify 打包 JS。

var config = {
  browserify: {
    bundleOptions: {
      entries: './tests/app.js',
      cache: {},
      packageCache: {}
    },
    filename: 'app.js',
    transforms: [['browserify-shim', {global: true}]],
    plugins: [],
    dist: 'dist',
    banner: false
  },
}

uglify

var config = {
  uglify: {
    src: './tasks/*.js',
    dist: './dist',
    banner: false
  }
}

markdown

var config = {
  md: {
    src: ['README.md'],
    data: {
      pluginTitle: 'Gulp Tasks for Amaze UI',
      pluginDesc: 'Amaze UI 插件开发 gulp 任务',
      buttons: 'amazeui/gulp-tasks' // GitHub 项目地址(去除 https://github.com/ 部分)
    },
    // gulp-rename 设置
    rename: function(file) {
      file.basename = file.basename.toLowerCase();
      if (file.basename === 'readme') {
        file.basename = 'index';
      }
      file.extname = '.html';
    },
    dist: function(file) {
      if (file.relative === 'index.html') {
        return 'dist'
      }
      return 'dist/docs';
    }
  },
}

clean

清理任务:

var config = {
  clean: '' // 要清理的文件夹
};

server

开发预览服务器:

release

发布任务:

  • publish:tag - 添加 tag 并 push 到远程 git 仓库
  • publish:npm - 发布到 NPM
  • publish:docs - Push 文档到 GitHub gh-pages 分支

gulp-tasks's People

Watchers

chadwick 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.