mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 05:07:22 +01:00
Simplified stylus task
This commit is contained in:
25
gulpfile.js
25
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));
|
||||
|
||||
Reference in New Issue
Block a user