Advertisement
Guest User

Untitled

a guest
Aug 1st, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. {
  2. "name": "my-project-name",
  3. "version": "0.1.0",
  4. "devDependencies": {
  5. "grunt": "~0.4.5",
  6. "grunt-contrib-cssmin": "^0.10.0",
  7. "grunt-contrib-jshint": "~0.10.0",
  8. "grunt-contrib-uglify": "~0.5.0",
  9. "grunt-contrib-watch": "^0.6.1",
  10. "matchdep": "^0.3.0"
  11. }
  12. }
  13.  
  14. module.exports = function(grunt){
  15.  
  16. //Loads the necessary tasks for this Grunt file.
  17. require('matchdep').filterDev('grunt-contrib-*').forEach(grunt.loadNpmTasks);
  18.  
  19. // Project configuration
  20. grunt.initConfig({
  21. // Load package.json file so that access is given to the project name and version number.
  22. pkg: grunt.file.readJSON('package.json'),
  23.  
  24. // Constants for the Gruntfile so we can easily change the path for our environments.
  25. //note: end with /
  26. BASE_PATH: '../',
  27. JS_SOURCE_PATH: '../js/src/',
  28. JS_BUILD_PATH: '../js/build/',
  29. CSS_SOURCE_PATH: '../css/src/',
  30. CSS_BUILD_PATH: '../css/build/',
  31.  
  32. uglify: {
  33. files: {
  34. expand: true,
  35. cwd: '<%= JS_SOURCE_PATH %>',
  36. src: '**/*.js',
  37. dest: '<%= JS_BUILD_PATH %>',
  38. flatten: false,
  39. }
  40. },
  41.  
  42. jshint: {
  43. options: {
  44. jshintrc: '<%= JS_SOURCE_PATH %>.jshintrc',
  45. force: true
  46. },
  47. all: [
  48. '<%= JS_SOURCE_PATH %>**/*.js',
  49. '!<%= JS_SOURCE_PATH %>third-party/**/*.js'
  50. ]
  51. },
  52.  
  53. cssmin: {
  54. options: {
  55. keepBreaks: true,
  56. report: 'gzip'
  57. },
  58. minify: {
  59. expand: true,
  60. cwd: '<%= CSS_SOURCE_PATH %>',
  61. src: '**/*.css',
  62. dest: '<%= CSS_BUILD_PATH %>'
  63. }
  64. },
  65.  
  66. watch: {
  67. options: {
  68. livereload: true,
  69. nospawn: true
  70. },
  71. js: {
  72. files: ['<%= JS_SOURCE_PATH %>**/*.js'],
  73. tasks: ['jshint']
  74. },
  75. css: {
  76. files: ['<%= CSS_SOURCE_PATH %>**/*.css'],
  77. tasks: ['cssmin']
  78. },
  79. html: {
  80. files: ['<%= BASE_PATH %>*.html']
  81. }
  82. }
  83. });
  84.  
  85.  
  86. grunt.registerTask('default', ['jshint', 'uglify', 'cssmin']);
  87.  
  88. grunt.registerTask('doit', ['uglify', 'cssmin']);
  89.  
  90. grunt.registerTask('css', ['cssmin']);
  91.  
  92. grunt.registerTask('hint', ['jshint']);
  93.  
  94. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement