You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 1.4 KiB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #Browsersync - Grunt & SASS
  2. ## Installation/Usage:
  3. To try this example, follow these 4 simple steps.
  4. **Step 1**: Clone this entire repo
  5. ```bash
  6. $ git clone https://github.com/Browsersync/recipes.git bs-recipes
  7. ```
  8. **Step 2**: Move into the directory containing this example
  9. ```bash
  10. $ cd bs-recipes/recipes/grunt.sass
  11. ```
  12. **Step 3**: Install dependencies
  13. ```bash
  14. $ npm install
  15. ```
  16. **Step 4**: Run the example
  17. ```bash
  18. $ npm start
  19. ```
  20. ### Additional Info:
  21. ### Preview of `Gruntfile.js`:
  22. ```js
  23. // This shows a full config file!
  24. module.exports = function (grunt) {
  25. grunt.initConfig({
  26. watch: {
  27. files: 'app/scss/**/*.scss',
  28. tasks: ['sass']
  29. },
  30. sass: {
  31. dev: {
  32. files: {
  33. 'app/css/main.css': 'app/scss/main.scss'
  34. }
  35. }
  36. },
  37. browserSync: {
  38. dev: {
  39. bsFiles: {
  40. src : [
  41. 'app/css/*.css',
  42. 'app/*.html'
  43. ]
  44. },
  45. options: {
  46. watchTask: true,
  47. server: './app'
  48. }
  49. }
  50. }
  51. });
  52. // load npm tasks
  53. grunt.loadNpmTasks('grunt-contrib-sass');
  54. grunt.loadNpmTasks('grunt-contrib-watch');
  55. grunt.loadNpmTasks('grunt-browser-sync');
  56. // define default task
  57. grunt.registerTask('default', ['browserSync', 'watch']);
  58. };
  59. ```