-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
44 lines (40 loc) · 1.25 KB
/
Copy pathgulpfile.js
File metadata and controls
44 lines (40 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Project specific variables
var url = 'styltheme.dev'; // Local dev URL. Change as needed.
// Load plugins
var gulp = require('gulp'),
stylus = require('gulp-stylus'),
jeet = require('jeet'), // stylus grid
autoprefixer = require('gulp-autoprefixer'),
minifyCss = require('gulp-minify-css'),
rename = require('gulp-rename'),
browserSync = require('browser-sync'),
reload = browserSync.reload;
// Styles
gulp.task('styles', function(){
gulp.src('./styl/*.styl') // Two files get compiled here: main stylsheet (all partials imported) and editor stylesheet. Makes for simple gulpfile config, but maybe not best approach. Comments welcome!
.pipe(stylus({
use: [jeet()],
sourcemap: { inline: true }
}))
.pipe(autoprefixer({
browsers: ['last 2 versions']
}))
.pipe(gulp.dest('./'))
.pipe(reload({ stream : true }))
// ---------------------------------------
// Uncomment next 3 lines for minified css
// ---------------------------------------
// .pipe(rename({ suffix: '.min' }))
// .pipe(minifyCss())
// .pipe(gulp.dest('./'))
});
// Browser Sync
gulp.task('browser-sync', function(){
browserSync({
proxy: url
})
});
// Watch!
gulp.task('watch', ['browser-sync'], function(){
gulp.watch('./styl/**/*.styl', ['styles']);
});