Rename plugin for Taskr
NOTE: This repository has been renamed from fly-rename to taskr-rename. If you haven't yet migrated to Taskr, now is the time to do so.
[![Dependency Status][david-dm-shield]][david-dm]
$ yarn add -D taskr taskr-rename
or
$ npm install --save-dev taskr taskr-rename
export default function* (task) {
yield task.source('./src/foo.js')
.rename({
dirname: 'dir/name',
basename: 'bar',
prefix: 'prefix-',
suffix: '-suffix',
extname: '.html'
})
.target('./dist')
// .dist/dir/name/prefix-bar-suffix.html
}
export default function* (task) {
yield task.source('./src/foo.js')
.rename((file) => {
file.dirname = 'dir/name'
file.basename = 'bar'
file.extname = '.html'
})
.target('./dist')
// .dist/dir/name/bar.html
}