Gruntfile.sass.server.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * Install:
  3. * npm install grunt grunt-contrib-watch grunt-contrib-sass grunt-browser-sync
  4. *
  5. * Run:
  6. * grunt
  7. *
  8. * This example will watch SCSS files & compile them.
  9. * BrowserSync will then inject the changes.
  10. */
  11. module.exports = function (grunt) {
  12. // Project configuration.
  13. grunt.initConfig({
  14. watch: {
  15. sass: {
  16. files: "app/scss/*.scss",
  17. tasks: "sass:dev"
  18. }
  19. },
  20. sass: {
  21. dev: {
  22. files: {
  23. "app/css/styles.css": "app/scss/styles.scss"
  24. }
  25. }
  26. },
  27. browserSync: {
  28. default_options: {
  29. bsFiles: {
  30. src: [
  31. "css/*.css",
  32. "*.html"
  33. ]
  34. },
  35. options: {
  36. watchTask: true,
  37. server: {
  38. baseDir: "./"
  39. }
  40. }
  41. }
  42. }
  43. });
  44. grunt.loadNpmTasks('grunt-contrib-watch');
  45. grunt.loadNpmTasks('grunt-contrib-sass');
  46. grunt.loadNpmTasks('grunt-browser-sync');
  47. grunt.registerTask('default', ['browserSync', 'watch']);
  48. };