Advertisement
Guest User

Untitled

a guest
Apr 20th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. module.exports = function(grunt) {
  2. grunt.initConfig({
  3. browserify: {
  4. dev: {
  5. options: {
  6. browserifyOptions: {
  7. debug: true
  8. },
  9. watch: true
  10. },
  11. src: 'js/main.js',
  12. dest: 'js/bundle.dev.js'
  13. },
  14. production: {
  15. options: {
  16. watch: true
  17. },
  18. src: '<%= browserify.dev.src %>',
  19. dest: 'js/bundle.js'
  20. }
  21. },
  22.  
  23. cssmin: {
  24. minify: {
  25. src: '<%= less.production.dest %>',
  26. dest: 'css/style.min.css'
  27. }
  28. },
  29.  
  30. jshint: {
  31. all: {
  32. files: {
  33. src: [
  34. 'js/*.js',
  35. '!<%= browserify.dev.dest %>',
  36. '!<%= browserify.production.dest %>',
  37. '!<%= uglify.production.dest %>'
  38. ]
  39. }
  40. }
  41. },
  42.  
  43. less: {
  44. dev: {
  45. options: {
  46. paths: ['css'],
  47. sourceMap: true
  48. },
  49. src: 'css/style.less',
  50. dest: 'css/style.dev.css'
  51. },
  52. production: {
  53. options: {
  54. paths: ['css'],
  55. yuicompress: true
  56. },
  57. src: '<%= less.dev.src %>',
  58. dest: 'css/style.css'
  59. }
  60. },
  61.  
  62. uglify: {
  63. production: {
  64. src: '<%= browserify.production.dest %>',
  65. dest: 'js/bundle.min.js'
  66. }
  67. },
  68.  
  69. watch: {
  70. jshint: {
  71. files: ['js/*.js'],
  72. tasks: ['jshint']
  73. },
  74.  
  75. less: {
  76. files: ['css/*.less', 'css/*/*.less'],
  77. tasks: ['less', 'cssmin']
  78. },
  79.  
  80. uglify: {
  81. files: ['<%= browserify.production.dest %>'],
  82. tasks: ['uglify']
  83. }
  84. }
  85. });
  86.  
  87. grunt.loadNpmTasks('grunt-browserify');
  88. grunt.loadNpmTasks('grunt-contrib-cssmin');
  89. grunt.loadNpmTasks('grunt-contrib-jshint');
  90. grunt.loadNpmTasks('grunt-contrib-less');
  91. grunt.loadNpmTasks('grunt-contrib-uglify');
  92. grunt.loadNpmTasks('grunt-contrib-watch');
  93.  
  94. grunt.registerTask('dev', ['browserify', 'watch']);
  95. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement