Last active
December 15, 2016 01:42
-
-
Save wwwmarcos/307bbec1cbcce8161d4cfd86c7262e89 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
const gulp = require('gulp'), | |
concat = require('gulp-concat'), | |
stylus = require('gulp-stylus'), | |
browserSync = require('browser-sync'), | |
cssmin = require('gulp-cssmin'), | |
rename = require('gulp-rename'), | |
reload = browserSync.reload | |
const paths = { | |
src: { | |
styl: 'src/styl/*.styl', | |
html: 'index.html', | |
}, | |
dist: { | |
css: 'dist/css/' | |
}, | |
watch: { | |
css: 'dist/css/*.css' | |
} | |
} | |
gulp.task('styles', () => { | |
gulp.src(paths.src.styl) | |
.pipe(stylus()) | |
.pipe(concat('app.css')) | |
.pipe(cssmin()) | |
.pipe(rename({ | |
suffix: '.min' | |
})) | |
.pipe(gulp.dest(paths.dist.css)) | |
}) | |
gulp.task('browser-sync', () => { | |
browserSync.init({ | |
open: true, | |
notify: false, | |
server: './' | |
}) | |
}) | |
gulp.task('default', ['browser-sync'], () => { | |
gulp.watch(paths.src.styl, ['styles']) | |
gulp.watch(paths.watch.css, reload) | |
gulp.watch(paths.src.html, reload) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment