diff --git a/gulpfile.js b/gulpfile.js index a0566b856c..01f41ffdbc 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,6 +9,7 @@ var gulp = require('gulp'), nodemon = require('gulp-nodemon'), karma = require('karma').server, stylus = require('gulp-stylus'), + filter = require('gulp-filter'), nib = require('nib'), minifycss = require('gulp-minify-css'), hash = require('gulp-hash'), @@ -28,10 +29,8 @@ var paths = { dest: "./website/build" }, stylus: { - src: { - app: './website/public/css/index.styl', - staticPage: './website/public/css/static.styl' // static is a 'future' reserved word - }, + src: ['./website/public/css/index.styl', + './website/public/css/static.styl'], dest: './website/build/', watch: './website/public/css/*.styl' }, @@ -89,22 +88,16 @@ gulp.task('clean', function() { rimraf.sync(paths.build.dest); }); -gulp.task('stylus:app', function() { - return gulp.src(paths.stylus.src.app) +gulp.task('stylus', function() { + var appFilter = filter(['*', '!static.styl']); + return gulp.src(paths.stylus.src) + .pipe(appFilter) + .pipe(rename('app.styl')) + .pipe(appFilter.restore()) .pipe(stylus({use: [nib()]})) - .pipe(rename('app.css')) .pipe(gulp.dest(paths.stylus.dest)); }); -gulp.task('stylus:static', function() { - return gulp.src(paths.stylus.src.staticPage) - .pipe(stylus({use: [nib()]})) - .pipe(rename('static.css')) - .pipe(gulp.dest(paths.stylus.dest)); -}); - -gulp.task('stylus', ['stylus:app', 'stylus:static'], function() { }); - gulp.task('copy', function() { gulp.src(paths.copy.src) .pipe(gulp.dest(paths.copy.dest)); diff --git a/package.json b/package.json index 3103499b45..f5f2924d2f 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "gulp-concat": "^2.4.3", "gulp-cssmin": "^0.1.6", "gulp-csso": "^1.0.0", + "gulp-filter": "^2.0.0", "gulp-hash": "^2.0.3", "gulp-minify-css": "^0.4.2", "gulp-nodemon": "^1.0.5",