Created
September 10, 2014 15:11
-
-
Save Damon4/bbbfc8b5f855b0d9d6f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp'); | |
| var urlAdjuster = require('gulp-css-url-adjuster'); | |
| var nib = require('nib'); | |
| var stylus = require('gulp-stylus'); | |
| var sourcemaps = require('gulp-sourcemaps'); | |
| var timestamp = Date.now(); | |
| // Get and render all .styl files recursively | |
| gulp.task('stylus', function () { | |
| gulp.src('./app/frontend/www/res/css/**/*.styl') | |
| .pipe(stylus({ | |
| use: [nib()], | |
| url: { | |
| name: 'embedurl' | |
| }, | |
| sourcemap: true, | |
| 'sourcemap-root': '/res/css/' | |
| })) | |
| .pipe(gulp.dest('./app/frontend/www/res/css/')); | |
| }); | |
| gulp.task('css-url', function() { | |
| return gulp.src(['./app/frontend/www/res/css/**/*.css']) | |
| .pipe(urlAdjuster({ | |
| append: function(s) { return s + '?'+timestamp; } | |
| })) | |
| .pipe(gulp.dest('./app/frontend/www/res/css/')); | |
| }); | |
| gulp.task('watch', function() { | |
| gulp.run('stylus'); | |
| gulp.watch('./app/frontend/www/res/css/**/*.styl', function() { | |
| gulp.run('stylus'); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment