Last active
August 29, 2015 14:12
-
-
Save phpmypython/79d114316fe4dcd7831e 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'), | |
| scss = require('gulp-sass'), | |
| notify = require('gulp-notify'); | |
| autoprefixer = require('gulp-autoprefixer'); | |
| minifyCss = require('gulp-minify-css'); | |
| gulp.task('styles', function () { | |
| return gulp.src('scss/main.scss') //This is the path to SCSS files that you want to compile. | |
| .pipe(scss()) | |
| .pipe(autoprefixer({ | |
| browsers: ['last 4 versions'], | |
| cascade: false | |
| })) | |
| .pipe(minifyCss({compatibility: 'ie8'})) | |
| .pipe(gulp.dest('css/')) //This is the path to where you want the css output. | |
| //.pipe(livereload()) | |
| .pipe(notify({ | |
| message: "SCSS Compiled." | |
| })); | |
| }); | |
| gulp.task('watch', function () { | |
| //livereload.listen(); | |
| gulp.watch('scss/*.scss',['styles']); | |
| gulp.watch('scss/*/*.scss', ['styles']); //This watches the directory where the SCSS is and upon changes it will run the styles task | |
| }); | |
| //The default Gulp task so we can kick it off by just running "gulp" | |
| gulp.task('build',['styles']); | |
| gulp.task('default', ['styles','watch']); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added Auto-Prefixing and minification.