What is broccoli-stew?
The broccoli-stew package provides a set of utilities for working with Broccoli.js, a JavaScript build tool. It offers functionalities such as debugging, filtering, and transforming files within a Broccoli build pipeline.
What are broccoli-stew's main functionalities?
Debugging
The debugging feature allows you to print out the contents of a tree at a specific point in the build pipeline. This is useful for understanding what files are being processed and for troubleshooting issues.
const stew = require('broccoli-stew');
const debugTree = stew.debug(tree, { name: 'my-tree' });
Filtering
The filtering feature allows you to include or exclude files based on a glob pattern. This is useful for processing only specific types of files within a larger set.
const stew = require('broccoli-stew');
const filteredTree = stew.filter(tree, '**/*.js');
Map
The map feature allows you to transform the contents of files within a tree. This is useful for tasks such as replacing text, modifying file contents, or applying other transformations.
const stew = require('broccoli-stew');
const mappedTree = stew.map(tree, (content, relativePath) => {
return content.replace(/foo/g, 'bar');
});
Other packages similar to broccoli-stew
broccoli-funnel
broccoli-funnel is a Broccoli plugin that allows you to filter files in a tree. It is similar to the filtering functionality in broccoli-stew but is more focused and specialized for this purpose.
broccoli-debug
broccoli-debug is a Broccoli plugin that provides debugging capabilities similar to the debugging feature in broccoli-stew. It allows you to inspect the contents of a tree at various points in the build pipeline.
broccoli-plugin
broccoli-plugin is a base class for creating Broccoli plugins. While it does not provide specific utilities like broccoli-stew, it is a foundational package for building custom Broccoli plugins with various functionalities.