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
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。