Skip to content
This repository has been archived by the owner on Nov 18, 2017. It is now read-only.

sunflowerdeath/broccoli-glob-caching-writer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

broccoli-glob-caching-writer

Similar to broccoli-caching-writer but allows to specify files that need to be cached using glob patterns.

Install

npm install broccoli-glob-caching-writer

Usage

var CachingWriter = require('broccoli-glob-caching-writer')

var MyWriter = function(inputTree, options) {
  CachingWriter.apply(this, arguments)
}
MyWriter.prototype = Object.create(CachingWriter.prototype)
MyWriter.prototype.updateCache = function(srcDirs, destDir) {
  //create result files
}


var tree = new MyWriter('inputTree', {
	files: ['**/*.js']
})

API

CachingWriter(inputTree, [options])

Constructor.

inputTree

Type: Tree

Input broccoli tree.

options

Type: object

Object with options.

options.files

Type: array.<string>

List of glob patterns to specify files that need to be cached.

Patterns that begin with ! will exclude files. Patterns are processed in order, so inclusion and exclusion order is significant.

CachingWriter.prototype.updateCache(srcDir, destDir, cachedFiles)

This method creates build results, it must be implemented in inherited class. It is called only when files in input tree are changed.

If you want to perform async operations, return a promise from this method.

srcDir

Type: string

Path of the inputTree.

destDir

Type: string

Path of directory for result files.

cachedFiles

Type: array.<string>

Array of cached files paths. Paths are relative to the inputTree.

License

Public domain, see the LICENCE.md file.

About

Caching writer for broccoli that allows to specify files that need to be cached using glob patterns.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published