gulp-component-build
gulp plugin for build component.
Last updated 6 years ago by hrsh7th .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gulp-component-build 
SYNC missed versions from official npm registry.

gulp-component-build.

gulp plugin to build component.

Example

var gulp = require('gulp');
var rename = require('gulp-rename');
var component = require('./index');

gulp.task('compile:scripts', function() {
  gulp.src('test/fixtures/success-component/component.json')
    .pipe(component.scripts({ install: true }))
    .pipe(rename('components.js'))
    .pipe(gulp.dest('public/js'));
});

gulp.task('compile:styles', function() {
  gulp.src('test/fixtures/success-component/component.json')
    .pipe(component.styles({ install: true }, function(styles, option) {
      styles.use('styles', require('component-builder-less')({}));
    }))
    .pipe(rename('components.css'))
    .pipe(gulp.dest('public/css'));
});

gulp.task('compile:files', function() {
  gulp.src('test/fixtures/success-component/component.json')
    .pipe(component.files({ install: true }, function(files, option) {
      // add to copy ext.
      build.fns.images.forEach(function(fn) {
        build.use('some-ext1', fn);
        build.use('some-ext2', fn);
      });
    }));
});

gulp.task('default', ['compile:scripts', 'compile:styles']);

api

component.scripts(option, configureFunction) #=> stream.

  • option
    • component/component-build's argument.
  • configureFunction
    • first argument
      • component/component-builder2 instance. can use to adding some plugins if you want.
    • second argument
      • option.

component.styles(option, configureFunction) #=> stream.

  • same to component.scripts

component.files(option, configureFunction) #=> stream.

  • same to component.scripts

Current Tags

  • 0.0.5                                ...           latest (6 years ago)

5 Versions

  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 2
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (4)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |