gulp-extname
gulp plugin to dynamically rewrite dest extensions based on src extensions.
Last updated 9 years ago by jonschlinkert .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install gulp-extname 
SYNC missed versions from official npm registry.

gulp-extname NPM version Build Status

gulp plugin to dynamically rewrite dest extensions based on src extensions.

(TOC generated by verb using markdown-toc)

Install

Install with npm:

$ npm i gulp-extname --save

Usage

var gulp = require('gulp');
var extname = require('gulp-extname');

gulp.task('default', function() {
  gulp.src('styles.less')
    .pipe(extname())
    .pipe(gulp.dest('dist/css'));
    //=> dist/css/styles.css
});

Define extension

Explicitly pass an extension to use. Any of these will work:

.pipe(extname('.foo'))

// or
.pipe(extname('foo'))

// or
.pipe(extname({ext: 'foo'}))

Extension mappings

The following extensions are mapped automatically:

// html
.md    //=> .html
.hbs   //=> .html
.swig  //=> .html
.tmpl  //=> .html
.html  //=> .html
.htm   //=> .html

// css
.less  //=> .css
.styl  //=> .css
.sass  //=> .css
.scss  //=> .css
.css   //=> .css

// js
.coffee//=> .js
.js    //=> .js

Add extension mappings, or use rewrite-ext for non-gulp projects.

Related projects

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2016 Jon Schlinkert Released under the MIT license.


This file was generated by verb on January 06, 2016.

Current Tags

  • 0.2.2                                ...           latest (9 years ago)

4 Versions

  • 0.2.2                                ...           9 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (4)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE