broccoli-read-compat

Use Broccoli's new .rebuild API and still support the legacy .read interface.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
broccoli-read-compat
0.1.37 years ago7 years agoMinified + gzip package size for broccoli-read-compat in KB

Readme

broccoli-read-compat
This packages allows you to use Broccoli's new .rebuild API and still support the legacy .read interface required for older Broccoli versions.

Usage

When defining your plugin, call readAPICompat.wrapFactory to add the legacy .read and .cleanup functions.
var fs = require('fs');
var readAPICompat = require('broccoli-read-compat');

function MyAwesomePlugin() { }

MyAwesomePlugin.prototype.rebuild = function() {
  var outputPath = this.outputPath;

  fs.writeFileSync(outputPath + '/' + 'awesome.txt', 'special sauce');
};

readAPICompat.wrapFactory(MyAwesomePlugin);