Açıklama Yok

Gruntfile.js 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. 'use strict';
  2. module.exports = function(grunt) {
  3. //Paths to folders
  4. var paths = {
  5. app: 'app',
  6. assets: 'assets',
  7. css: 'public/css',
  8. js: 'public/js',
  9. fonts: 'public/fonts',
  10. views: 'app/views'
  11. };
  12. //Load tasks in Gruntfile
  13. require('jit-grunt')(grunt);
  14. // Project configuration.
  15. grunt.initConfig({
  16. pkg: grunt.file.readJSON('package.json'),
  17. paths: paths,
  18. autoprefixer: {
  19. options: {
  20. map: true
  21. },
  22. css: {
  23. expand: true,
  24. flatten: true,
  25. src: '<%= paths.css %>/*.css',
  26. dest: '<%= paths.css %>'
  27. },
  28. },
  29. concat: {
  30. options: {
  31. separator: ';',
  32. stripBanners: true,
  33. banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - '
  34. + '<%= grunt.template.today("yyyy-mm-dd") %> */',
  35. sourceMap: true
  36. },
  37. js: {
  38. files: {
  39. '<%= paths.js %>/main.js %>': '<%= paths.assets %>/js/*.js %>'
  40. }
  41. }
  42. },
  43. clean: {
  44. js: ['<%= paths.js%>'],
  45. css: ['<%= paths.css%>']
  46. },
  47. cssmin: {
  48. minify: {
  49. expand: true,
  50. cwd: '<%= paths.css %>',
  51. src: ['*.css', '!*.min.css'],
  52. dest: '',
  53. ext: '.min.css'
  54. }
  55. },
  56. jshint: {
  57. all: ['Gruntfile.js']
  58. },
  59. sass: {
  60. dist: {
  61. files: [{
  62. src: ['<%= paths.assets %>/sass/master.scss'],
  63. dest: '<%= paths.css %>/master.css'
  64. }],
  65. options: {
  66. loadPath: [
  67. 'vendor/bower_components/bourbon/dist',
  68. 'vendor/bower_components/neat/app/assets/stylesheets'
  69. ]
  70. }
  71. }
  72. },
  73. uglify: {
  74. options: {
  75. banner: '/*! <%= pkg.name %> - <%= pkg.author %> -<%= grunt.template.today("yyyy-mm-dd") %> */\n'
  76. },
  77. build: {
  78. src: 'src/<%= pkg.name %>.js',
  79. dest: 'build/<%= pkg.name %>.min.js'
  80. }
  81. },
  82. watch: {
  83. sass: {
  84. files: '<%= paths.assets %>/sass/**/*.scss',
  85. tasks: ['sass']
  86. }
  87. }
  88. });
  89. // Default task(s).
  90. grunt.registerTask('default', [
  91. 'clean',
  92. 'sass',
  93. 'autoprefixer',
  94. 'cssmin',
  95. 'jshint',
  96. 'concat',
  97. 'uglify']);
  98. };