Skip to content

Commit

Permalink
Merge pull request #50 from alexdancho/extDot-docs
Browse files Browse the repository at this point in the history
Adds documentation for extDot
  • Loading branch information
vladikoff committed Mar 10, 2014
2 parents 2f1cb49 + 1533580 commit 474a0c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Configuring-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ When you want to process many individual files, a few additional properties may
* `src` Pattern(s) to match, relative to the `cwd`.
* `dest` Destination path prefix.
* `ext` Replace any existing extension with this value in generated `dest` paths.
* `extDot` Used to indicate where the period indicating the extension is located. Can take either `'first'` (extension begins after the first period in the file name) or `'last'` (extension begins after the last period), and is set by default to `'first'`.
* `flatten` Remove all path parts from generated `dest` paths.
* `rename` This function is called for each matched `src` file, (after extension renaming and flattening). The `dest`
and matched `src` path are passed in, and this function must return a new `dest` value. If the same `dest` is returned
Expand Down Expand Up @@ -276,6 +277,7 @@ grunt.initConfig({
src: ['**/*.js'], // Actual pattern(s) to match.
dest: 'build/', // Destination path prefix.
ext: '.min.js', // Dest filepaths will have this extension.
extDot: 'first' // Extensions in filenames begin after the first dot
},
],
},
Expand Down
10 changes: 8 additions & 2 deletions grunt.file.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,15 @@ var options = {
// Remove the path component from all matched src files. The src file path
// is still joined to the specified dest.
flatten: Boolean,
// Remove anything after (and including) the first "." in the destination
// path, then append this value.
// Remove anything after (and including) either the first or last "." in the
// destination path (indicated by options.extDot), then append this value.
ext: String,
// *Added in 0.4.3*
// Indicates where the period demarcating the extension is located. Can take:
// - 'first' (extension begins after the first period in the file name)
// - 'last' (extension begins after the last period)
// Default: 'first'
extDot: String,
// If specified, this function will be responsible for returning the final
// dest filepath. By default, it joins dest and matchedSrcPath like so:
rename: function(dest, matchedSrcPath, options) {
Expand Down

0 comments on commit 474a0c2

Please sign in to comment.