gruntfile.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. 'use strict';
  2. module.exports = function(grunt) {
  3. require('load-grunt-tasks')(grunt);
  4. grunt.initConfig({
  5. watch: {
  6. compass: {
  7. files: ['css/**/*.sass'],
  8. tasks: ['sass']
  9. },
  10. js: {
  11. files: '<%= jshint.all %>',
  12. tasks: ['jshint', 'uglify']
  13. },
  14. livereload: {
  15. options: { livereload: true },
  16. files: ['style.css', 'js/*.js', '*.html', '*.php', 'img/**/*.{png,jpg,jpeg,gif,webp,svg}']
  17. }
  18. },
  19. jshint: {
  20. options: {
  21. jshintrc: '.jshintrc',
  22. 'force': true
  23. },
  24. all: [
  25. 'Gruntfile.js',
  26. 'js/source/**/*.js'
  27. ]
  28. },
  29. uglify: {
  30. build: {
  31. src: 'js/script.js',
  32. dest: 'js/script.min.js'
  33. },
  34. build: {
  35. src: 'js/init.js',
  36. dest: 'js/init.min.js'
  37. }
  38. },
  39. phpunit: {
  40. all: {
  41. dir: 'tests/phpunit/'
  42. }
  43. },
  44. });
  45. grunt.loadNpmTasks('grunt-contrib-jshint');
  46. grunt.loadNpmTasks('grunt-contrib-watch');
  47. grunt.registerTask('default', ['watch']);
  48. };