gulpfile.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Include gulp
  2. var gulp = require('gulp');
  3. // Include Our Plugins
  4. var wrap = require('gulp-wrap');
  5. var autoprefixer = require('gulp-autoprefixer');
  6. var sass = require('gulp-sass');
  7. var plumber = require('gulp-plumber');
  8. // Compile our SCSS
  9. gulp.task('scss', function() {
  10. return gulp.src( 'scss/main.scss')
  11. .pipe(plumber({
  12. errorHandler: function (err) {
  13. console.log(err.formatted);
  14. this.emit('end');
  15. }
  16. }))
  17. .pipe(sass())
  18. .pipe(autoprefixer({
  19. browsers: ['last 3 versions'],
  20. cascade: false
  21. }))
  22. .pipe(wrap('<style type="text/css">\n<%= contents %>\n</style>'))
  23. .pipe(gulp.dest('css'));
  24. });
  25. //
  26. // gulp.task('wrap', function(){
  27. // return gulp.src( 'bower_components/lightbox2/dist/css/lightbox.min.css')
  28. // .pipe(wrap('<style type="text/css">\n<%= contents %>\n</style>'))
  29. // .pipe(gulp.dest('css'));
  30. // })
  31. // Watch Files For Changes
  32. gulp.task('dev-watch', function() {
  33. gulp.watch( 'scss/*.scss', ['scss']);
  34. });
  35. // Default Task
  36. gulp.task('default', ['scss']);