Advertisement
Guest User

Untitled

a guest
May 29th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. var gulp = require('gulp');
  2. var sass = require('gulp-sass');
  3. var sourcemaps = require('gulp-sourcemaps');
  4.  
  5. var config = {
  6. sassPath: './src/sass/',
  7. bowerDir: './bower_components',
  8. autoprefixer: {
  9. cascade: true
  10. },
  11. paths: {
  12. output: 'dist/'
  13. }
  14. }
  15.  
  16. //TODO:
  17. //if(/prod/.test(env)) {
  18. // config.sass.outputStyle = 'compressed';
  19. //}
  20.  
  21. gulp.task('sass', function() {
  22. gulp.src(config.sassPath + '**/*.scss')
  23. .pipe(sourcemaps.init())
  24. .pipe(sass({
  25. style: 'expanded',
  26. includePaths: [
  27. config.sassPath,
  28. config.bowerDir + '/bootstrap-sass-official/assets/stylesheets',
  29. ],
  30. errLogToConsole: true }))
  31. //.pipe(autoprefixer(config.autoprefixer))
  32. .pipe(sourcemaps.write('./maps'))
  33. .pipe(gulp.dest(config.paths.output))
  34. });
  35.  
  36. // Rerun the task when a file changes
  37. gulp.task('watch', function() {
  38. gulp.watch(config.sassPath + '/**/*.scss', ['sass']);
  39. });
  40.  
  41. gulp.task('default', ['sass']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement