gulpfile.js 860 B

12345678910111213141516171819202122232425262728293031323334
  1. var gulp = require('gulp');
  2. var path = require('path');
  3. var sass = require('gulp-sass');
  4. var autoprefixer = require('gulp-autoprefixer');
  5. var sourcemaps = require('gulp-sourcemaps');
  6. var open = require('gulp-open');
  7. var Paths = {
  8. HERE: './',
  9. DIST: 'dist/',
  10. CSS: './assets/css/',
  11. SCSS_TOOLKIT_SOURCES: './assets/scss/paper-dashboard.scss',
  12. SCSS: './assets/scss/**/**'
  13. };
  14. gulp.task('compile-scss', function() {
  15. return gulp.src(Paths.SCSS_TOOLKIT_SOURCES)
  16. .pipe(sourcemaps.init())
  17. .pipe(sass().on('error', sass.logError))
  18. .pipe(autoprefixer())
  19. .pipe(sourcemaps.write(Paths.HERE))
  20. .pipe(gulp.dest(Paths.CSS));
  21. });
  22. gulp.task('watch', function() {
  23. gulp.watch(Paths.SCSS, ['compile-scss']);
  24. });
  25. gulp.task('open', function() {
  26. gulp.src('examples/dashboard.html')
  27. .pipe(open());
  28. });
  29. gulp.task('open-app', ['open', 'watch']);