mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 13:17:24 +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'),
|
nodemon = require('gulp-nodemon'),
|
||||||
karma = require('karma').server,
|
karma = require('karma').server,
|
||||||
stylus = require('gulp-stylus'),
|
stylus = require('gulp-stylus'),
|
||||||
|
filter = require('gulp-filter'),
|
||||||
nib = require('nib'),
|
nib = require('nib'),
|
||||||
minifycss = require('gulp-minify-css'),
|
minifycss = require('gulp-minify-css'),
|
||||||
hash = require('gulp-hash'),
|
hash = require('gulp-hash'),
|
||||||
@@ -28,10 +29,8 @@ var paths = {
|
|||||||
dest: "./website/build"
|
dest: "./website/build"
|
||||||
},
|
},
|
||||||
stylus: {
|
stylus: {
|
||||||
src: {
|
src: ['./website/public/css/index.styl',
|
||||||
app: './website/public/css/index.styl',
|
'./website/public/css/static.styl'],
|
||||||
staticPage: './website/public/css/static.styl' // static is a 'future' reserved word
|
|
||||||
},
|
|
||||||
dest: './website/build/',
|
dest: './website/build/',
|
||||||
watch: './website/public/css/*.styl'
|
watch: './website/public/css/*.styl'
|
||||||
},
|
},
|
||||||
@@ -89,22 +88,16 @@ gulp.task('clean', function() {
|
|||||||
rimraf.sync(paths.build.dest);
|
rimraf.sync(paths.build.dest);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('stylus:app', function() {
|
gulp.task('stylus', function() {
|
||||||
return gulp.src(paths.stylus.src.app)
|
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(stylus({use: [nib()]}))
|
||||||
.pipe(rename('app.css'))
|
|
||||||
.pipe(gulp.dest(paths.stylus.dest));
|
.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.task('copy', function() {
|
||||||
gulp.src(paths.copy.src)
|
gulp.src(paths.copy.src)
|
||||||
.pipe(gulp.dest(paths.copy.dest));
|
.pipe(gulp.dest(paths.copy.dest));
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
"gulp-concat": "^2.4.3",
|
"gulp-concat": "^2.4.3",
|
||||||
"gulp-cssmin": "^0.1.6",
|
"gulp-cssmin": "^0.1.6",
|
||||||
"gulp-csso": "^1.0.0",
|
"gulp-csso": "^1.0.0",
|
||||||
|
"gulp-filter": "^2.0.0",
|
||||||
"gulp-hash": "^2.0.3",
|
"gulp-hash": "^2.0.3",
|
||||||
"gulp-minify-css": "^0.4.2",
|
"gulp-minify-css": "^0.4.2",
|
||||||
"gulp-nodemon": "^1.0.5",
|
"gulp-nodemon": "^1.0.5",
|
||||||
|
|||||||
Reference in New Issue
Block a user