1.0.0 • Published 7 years ago
bundl-copy v1.0.0
bundl-copy
Copy matched src files into another directory
Runs with the amazing Bundl build tool at the src stage
Install
$ npm install --save-dev bundl-copyUse
var Bundl = require('bundl');
var copy = require('bundl-copy');
var options = {
dest: 'dist/public',
flatten: true
};
new Bundl(targets)
.src(copy(options))
.go();Setting the destination path (required)
This can be done by simply passing a string into the copy plugin
copy('dist/public')Or, if more options are needed, it can be set as a member of the options object
copy({ dest: 'dist/public' })Options
basedir
By default, copied files maintain their original paths relative to basedir when copied into the dest folder. If basedir is not specified, process.cwd() will be used.
{
basedir: 'src/stylesheets'
}filter
If provided, this Function will be used to filter which files should be copied. Returning true allows the current file to be copied. Returning false skips the current file.
{
filter: function (extName, fileName, srcPath) {
if (extName === 'css' && fileName.indexOf('_private') === -1) {
return true;
}
}
}flatten
Setting flatten to true will cause all matched files to be copied into the root of dest (basedir will be ignored).
{
flatten: true
}