gruntfile.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. module.exports = function(grunt) {
  2. grunt.initConfig({
  3. pkg: grunt.file.readJSON('package.json'),
  4. htmlmin: {
  5. dist: {
  6. options: {
  7. removeComments: true,
  8. collapseWhitespace: true
  9. },
  10. files: {
  11. 'svg.html': 'svg.min.html',
  12. }
  13. },
  14. dev: {
  15. files: {
  16. 'svg.html': 'svg.min.html'
  17. }
  18. }
  19. },
  20. cssmin: {
  21. css: {
  22. src: 'css/grid.css',
  23. dest: 'css/grid.min.css'
  24. }
  25. },
  26. cssmin: {
  27. combine: {
  28. files: {
  29. 'css/style.min.css': ['css/styles.css', 'css/bootstrap.css', 'css/font-awesome.css' ]
  30. }
  31. }
  32. },
  33. concat: {
  34. options: {
  35. separator: ';',
  36. },
  37. dist: {
  38. src: ['js/scripts.js', 'js/bootstrap.min.js', 'js/jasny-canvas.js'],
  39. dest: 'js/script.js',
  40. },
  41. },
  42. jshint: {
  43. options: {
  44. jshintrc: 'js/.jshintrc'
  45. },
  46. all: ['js/init.js'],
  47. },
  48. uglify: {
  49. my_target: {
  50. files: {
  51. 'js/script.min.js': ['js/script.js']
  52. }
  53. }
  54. }
  55. });
  56. grunt.loadNpmTasks('grunt-contrib-htmlmin');
  57. grunt.loadNpmTasks('grunt-contrib-cssmin');
  58. grunt.loadNpmTasks('grunt-contrib-concat');
  59. grunt.loadNpmTasks('grunt-contrib-jshint');
  60. grunt.loadNpmTasks('grunt-contrib-uglify');
  61. grunt.registerTask('htmlmin', [ 'htmlmin' ]);
  62. grunt.registerTask('jshint', [ 'jshint' ]);
  63. grunt.registerTask('default', [ 'cssmin', 'concat', 'uglify' ]);
  64. };