Gruntfile.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*global module:false*/
  2. module.exports = function(grunt) {
  3. grunt.initConfig({
  4. myth: {
  5. compile: {
  6. expand: true,
  7. cwd: 'css',
  8. src: ['*.css', '!*.min.css'],
  9. dest: 'css',
  10. ext: '.css'
  11. },
  12. release: {
  13. files: {
  14. 'dist/flexboxgrid.css': 'src/css/flexboxgrid.css'
  15. }
  16. }
  17. },
  18. cssmin: {
  19. concat: {
  20. files: {
  21. 'css/index.css': ['vendor/css/normalize.css', 'src/css/style.css', 'dist/flexboxgrid.css']
  22. }
  23. },
  24. minify: {
  25. expand: true,
  26. cwd: 'css',
  27. src: ['*.css', '!*.min.css'],
  28. dest: 'css',
  29. ext: '.min.css'
  30. },
  31. release: {
  32. expand: true,
  33. cwd: 'dist',
  34. src: ['*.css', '!*.min.css'],
  35. dest: 'dist',
  36. ext: '.min.css'
  37. }
  38. },
  39. uglify: {
  40. release: {
  41. files: {
  42. 'js/index.js': 'src/js/index.js'
  43. }
  44. }
  45. },
  46. processhtml: {
  47. dist: {
  48. options: {
  49. process: true
  50. },
  51. files: {
  52. 'index.html': ['src/index.html']
  53. }
  54. }
  55. },
  56. htmlmin: {
  57. dist: {
  58. options: {
  59. removeComments: true,
  60. collapseWhitespace: true
  61. },
  62. files: {
  63. 'index.html': ['index.html']
  64. }
  65. }
  66. },
  67. watch: {
  68. css: {
  69. files: 'src/**/*',
  70. tasks: ['default'],
  71. },
  72. livereload: {
  73. options: {
  74. livereload: true,
  75. },
  76. files: [
  77. 'index.html',
  78. 'css/*.css',
  79. 'js/*.js',
  80. 'img/*'
  81. ]
  82. }
  83. }
  84. });
  85. // These plugins provide necessary tasks.
  86. grunt.loadNpmTasks('grunt-myth');
  87. grunt.loadNpmTasks('grunt-contrib-cssmin');
  88. grunt.loadNpmTasks('grunt-contrib-uglify');
  89. grunt.loadNpmTasks('grunt-contrib-watch');
  90. grunt.loadNpmTasks('grunt-processhtml');
  91. grunt.loadNpmTasks('grunt-contrib-htmlmin');
  92. // Default task.
  93. grunt.registerTask('default', [
  94. 'myth',
  95. 'cssmin:concat',
  96. 'cssmin:minify',
  97. 'cssmin:release',
  98. 'uglify',
  99. 'processhtml',
  100. 'htmlmin'
  101. ]);
  102. grunt.registerTask('reload', ['watch']);
  103. };