Skip to content

Commit ea20eb1

Browse files
committed
Merge pull request #16 from sivakumar-kailasam/master
Minify CSS in dist task
2 parents 2c03521 + d386775 commit ea20eb1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"gulp-gh-pages": "^0.5.2",
2828
"gulp-git": "^1.4.0",
2929
"gulp-less": "^3.0.3",
30+
"gulp-minify-css": "^1.2.1",
3031
"gulp-rename": "^1.2.2",
3132
"gulp-streamify": "^1.0.2",
3233
"gulp-uglify": "^1.4.1",

tasks/dist.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var shim = require('browserify-shim');
88
var source = require('vinyl-source-stream');
99
var streamify = require('gulp-streamify');
1010
var uglify = require('gulp-uglify');
11+
var minifyCSS = require('gulp-minify-css');
1112

1213
module.exports = function (gulp, config) {
1314
gulp.task('clean:dist', function (done) {
@@ -44,7 +45,11 @@ module.exports = function (gulp, config) {
4445
gulp.task('build:dist:css', ['clean:dist'], function () {
4546
return gulp.src(config.component.less.path + '/' + config.component.less.entry)
4647
.pipe(less())
47-
.pipe(gulp.dest('dist'));
48+
.pipe(rename(config.component.pkgName + '.css'))
49+
.pipe(gulp.dest('dist'))
50+
.pipe(rename(config.component.pkgName + '.min.css'))
51+
.pipe(minifyCSS())
52+
.pipe(gulp.dest('dist'))
4853
});
4954
buildTasks.push('build:dist:css');
5055
}

0 commit comments

Comments
 (0)