gulp-dynamic-name
gulp-dynamic-name is a gulp plugin to rename files easily.
Usage
gulp-dynamic-name is heavily based on the gulp-rename package, extending it to allow for dynamic naming of files within a stream using a structured object on the first line of the file. Useful for naming and building files in a build process when combined with the likes of Jade.
It provides all the features and methods of gulp-rename plus an extended feature set
Example
Assuming your using Jade to build out a series of templates
//- { "dest_path": "./dist", "dest_name" : "lazy-dog" }doctype html html body P The Quick Brown Fox Jumped Over The Lazy Dog
var rename = ;var linereader = ;var intercept = ; // dynamically naming and positioning a jade filereturn gulp
Notes
extname
is the file extension including the '.' like path.extname(filename).- The file bring renamed must contain a structured JSON object on the first line of the file
dest_path
is the path to where the compiled file should be sentdest_name
the base name the file should be called