Expand target definitions in a declarative configuration.
Install with npm:
$ npm install --save expand-target
var target = ;
Write declarative "target" definitions similar in concept to those used by grunt and make. This is useful for shared configs or to dynamically build-up a configuration that can be passed to any build system (even gulp!).
files:src: 'examples.js' 'index.js'dest: 'a/'src: 'examples.js' 'index.js'dest: 'b/'src: 'examples.js' 'index.js'dest: 'c/'
the same example with
expand: truedefined on the options
options:expand: truefiles:src: 'examples.js'dest: 'a/examples.js'src: 'index.js'dest: 'a/index.js'src: 'examples.js'dest: 'b/examples.js'src: 'index.js'dest: 'b/index.js'src: 'examples.js'dest: 'c/examples.js'src: 'index.js'dest: 'c/index.js'
Plugins must be registered before the configuration is expanded, which means you need to use the
expand method instead of passing your config directly to the constructor.
var target = cwd: 'foo';target;target;
Plugins are just functions where the only parameter exposed is the current "context".
In the following plugin,
config is the target instance:
To have the plugin called in a "child" context, like for iterating over files nodes as they're expanded, just return the plugin function until you get the node you want:
To see all available contexts, just do the following:
Any option from expand-files may be used. Please see that project for the full range of options and documentation.
The below "special" properties are fine to use either on an
options object or on the root of the object passed to
Either way they will be normalized onto the
options object to ensure that globby and consuming libraries are passed the correct arguments.
Both of the following will result in
expand being on the
- expand-config: Expand tasks, targets and files in a declarative configuration. | homepage
- expand-files: Expand glob patterns in a declarative configuration into src-dest mappings. | homepage
- expand-target: Expand target definitions in a declarative configuration. | homepage
- expand-task: Expand and normalize task definitions in a declarative configuration. | homepage
- files-objects: Expand files objects into src-dest mappings. | homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
To generate the readme and API documentation with verb:
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
$ npm install -d && npm test
This file was generated by verb, v0.9.0, on July 19, 2016.