Skip to content

chinjs/chin-plugin-gulp

Repository files navigation

chin-plugin-gulp

npm npm Build Status Coverage Status

chin plugin for using gulp plugins.

Installation

yarn add -D chin chin-plugin-gulp

Usage

gulp(plugins: () => stream[])

import gulp from 'chin-plugin-gulp'
import sass from 'gulp-sass'
import autoprefixer from 'gulp-autoprefixer'
import minify from 'gulp-minify-css'

const sass2css = gulp(() => [
  sass(),
  autoprefixer(),
  minify()
])

export default {
  put,
  out,
  processors: { sass: sass2css }
}

concat(plugins) / dest(path)

Instead of gulp-concat which can not be used in chin.

import { concat } from 'chin-plugin-gulp'
import sass from 'gulp-sass'
import autoprefixer from 'gulp-autoprefixer'
import minify from 'gulp-minify-css'

const sass2css = concat(() => [
  sass(),
  autoprefixer(),
  minify()
])

export default {
  put,
  out,
  processors: { sass: sass2css },
  after: () => sass2css.dest('dist/concated.css')
}

License

MIT (http://opensource.org/licenses/MIT)