Using gulp-rename npm install --save-dev gulp-rename
gulpfile.js:
// including plugins var gulp = require('gulp'); var rename = require('gulp-rename'); var coffee = require("gulp-coffee"); // task gulp.task('rename', function () { gulp.src('./CoffeeScript/one.coffee') // path to your file .pipe(coffee()) // compile coffeeScript .pipe(rename('renamed.js')) // rename into "renamed.js" (original name "one.js") .pipe(gulp.dest('path/to/destination')); });
Run:
gulp rename