From 7a8b47179c9ff252ccc5f72c789a14111b3bda46 Mon Sep 17 00:00:00 2001 From: Hyunje Alex Jun Date: Thu, 12 Feb 2015 18:32:17 +0000 Subject: [PATCH] Change global outputs' names to just `perfect-scrollbar`. --- gulpfile.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 789756b..9026fbc 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -38,8 +38,12 @@ function browserified() { gulp.task('js', ['clean:js'], function () { return gulp.src('./src/js/adaptor/*.js') .pipe(browserified()) - .pipe(rename({ - prefix: 'perfect-scrollbar.' + .pipe(rename(function (path) { + if (path.basename === 'global') { + path.basename = 'perfect-scrollbar'; + } else { + path.basename = 'perfect-scrollbar.' + path.basename; + } })) .pipe(gulp.dest('./out/js')) .pipe(connect.reload()); @@ -49,9 +53,12 @@ gulp.task('js:min', ['clean:js:min'], function () { return gulp.src('./src/js/adaptor/*.js') .pipe(browserified()) .pipe(uglify()) - .pipe(rename({ - prefix: 'perfect-scrollbar.', - suffix: '.min' + .pipe(rename(function (path) { + if (path.basename === 'global') { + path.basename = 'perfect-scrollbar.min'; + } else { + path.basename = 'perfect-scrollbar.' + path.basename + '.min'; + } })) .pipe(gulp.dest('./out/js/min')); });