0.2.0 • Published 9 years ago

gulp-empathy v0.2.0

Weekly downloads
10
License
-
Repository
github
Last release
9 years ago

gulp-empathy

Declarative path mapping and concatenation for gulp.

Installation

npm install gulp-empathy

Example

empathy = require 'gulp-empathy'

{task} = empathy require('gulp'),
  source: 'src'
  target: 'build'
  ignore: ['**/_*', '**/_*/**']
  map:
    markup: '**/*.{html,jade}'
    styles:
      'styles/app.css': '**/*.{css,styl}'
      'styles/vendor.css': [
        './vendor/normalize.css'
        './vendor/grid.css'
      ]

task 'markup', ->
  @stream.pipe $.if '*.jade', jade()

task 'styles', ->
  @stream
    .pipe $.if '*.styl', stylus()
    .pipe csso()

A working example can be seen here.

Notes

Instead of using gulp.src or gulp.dest, use only @stream. All other gulp rules apply (such as a function callback or returning a stream).

You can assign a function to @after inside of a task (do this before you use @stream, since it needs to be returned) and it will be called after gulp.dest (useful for streaming changes) Return the result of stream.pipe from @after's callback.

Any path that begins with '.' (for instance './' or '../') will not have source or target paths prefixed. This is useful for sourcing files from, for example, './node_modules/' or './bower_components/'.

0.2.1

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago