Rename file in Mimosa
CoffeeScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
.npmignore
LICENSE
README.md
mimosa-config.coffee
package.json

README.md

mimosa-rename

This Mimosa module will rename files before they are written.

For more information regarding Mimosa, see http://mimosa.io

Usage

Add 'rename' to your list of modules.

Default Config

rename: {
  map: []
}

map array of arrays

Each mapping array contains two elements: a regex to match a file name, and the regex replace string/function. The regex is matched against the absolute path of the output file.

Example Config

rename: {
  map: [
    [/public\/javascripts\/foo.js/, "public/javascripts/bar.js"],
    [/public\/svgs\/([A-Za-z0-9-_]+).svg/, "public/images/svgs/$1.svg"]
  ]
}
  • The first entry in the map above does a simple full name replace.
  • The second entry moves all your svgs/*.svg to the images/svgs directory.