1

Minify styles in addition to scripts

This commit is contained in:
Alex Yatskov 2014-09-30 16:11:54 +09:00
parent c3987d1dc2
commit 57a06b830b
5 changed files with 37 additions and 3376 deletions

3363
client/dist/all.js vendored

File diff suppressed because one or more lines are too long

14
client/dist/styles.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,9 @@
var concat = require('gulp-concat'); var concat = require('gulp-concat');
var gulp = require('gulp'); var gulp = require('gulp');
var jshint = require('gulp-jshint'); var jshint = require('gulp-jshint');
var rename = require('gulp-rename'); var minifyCss = require('gulp-minify-css');
var sourcemaps = require('gulp-sourcemaps'); var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify'); var uglify = require('gulp-uglify');
var mainBowerFiles = require('main-bower-files');
var paths = { var paths = {
js: [ js: [
@ -16,10 +15,15 @@ var paths = {
'bower_components/bootstrap/dist/js/bootstrap.min.js', 'bower_components/bootstrap/dist/js/bootstrap.min.js',
'bower_components/bootstrap-select/dist/js/bootstrap-select.min.js', 'bower_components/bootstrap-select/dist/js/bootstrap-select.min.js',
'js/*.js' 'js/*.js'
] ],
css: [
'bower_components/bootstrap/dist/css/bootstrap.min.css',
'bower_components/bootstrap/dist/css/bootstrap-theme.min.css',
'bower_components/bootstrap-select/dist/css/bootstrap-select.min.css',
'css/*.css'
],
}; };
gulp.task('lint', function() { gulp.task('lint', function() {
return gulp.src('js/*.js') return gulp.src('js/*.js')
.pipe(jshint()) .pipe(jshint())
@ -28,11 +32,16 @@ gulp.task('lint', function() {
gulp.task('scripts', function() { gulp.task('scripts', function() {
return gulp.src(paths.js) return gulp.src(paths.js)
.pipe(concat('all.js')) .pipe(concat('scripts.js'))
.pipe(gulp.dest('dist'))
.pipe(rename('all.min.js'))
.pipe(uglify()) .pipe(uglify())
.pipe(gulp.dest('dist')); .pipe(gulp.dest('dist'));
}); });
gulp.task('default', ['scripts']); gulp.task('styles', function() {
return gulp.src(paths.css)
.pipe(concat('styles.css'))
.pipe(minifyCss())
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['lint', 'scripts', 'styles']);

View File

@ -12,6 +12,7 @@
"gulp": "^3.8.8", "gulp": "^3.8.8",
"gulp-concat": "^2.4.1", "gulp-concat": "^2.4.1",
"gulp-jshint": "^1.8.4", "gulp-jshint": "^1.8.4",
"gulp-minify-css": "^0.3.10",
"gulp-rename": "^1.2.0", "gulp-rename": "^1.2.0",
"gulp-sourcemaps": "^1.2.2", "gulp-sourcemaps": "^1.2.2",
"gulp-uglify": "^1.0.1", "gulp-uglify": "^1.0.1",