Gruntfile.coffee 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. path = require 'path'
  2. # Build configurations.
  3. module.exports = (grunt) ->
  4. grunt.initConfig
  5. # Metadata
  6. pkg: grunt.file.readJSON('package.json'),
  7. banner: '/*\n' +
  8. ' <%= pkg.name %> v<%= pkg.version %>\n' +
  9. ' <%= pkg.homepage %>\n' +
  10. '*/\n'
  11. # Deletes built file and temp directories.
  12. clean:
  13. working:
  14. src: [
  15. 'angular-file-upload.*'
  16. ]
  17. uglify:
  18. # concat js files before minification
  19. js:
  20. src: ['angular-file-upload.js']
  21. dest: 'angular-file-upload.min.js'
  22. options:
  23. banner: '<%= banner %>'
  24. sourceMap: (fileName) ->
  25. fileName.replace /\.js$/, '.map'
  26. concat:
  27. # concat js files before minification
  28. js:
  29. options:
  30. banner: '<%= banner %>'
  31. stripBanners: true
  32. src: [
  33. 'src/intro.js',
  34. 'src/module.js',
  35. 'src/outro.js'
  36. ]
  37. dest: 'angular-file-upload.js'
  38. # Register grunt tasks supplied by grunt-contrib-*.
  39. # Referenced in package.json.
  40. # https://github.com/gruntjs/grunt-contrib
  41. grunt.loadNpmTasks 'grunt-contrib-clean'
  42. grunt.loadNpmTasks 'grunt-contrib-copy'
  43. grunt.loadNpmTasks 'grunt-contrib-uglify'
  44. grunt.loadNpmTasks 'grunt-contrib-concat'
  45. grunt.registerTask 'default', [
  46. 'clean'
  47. 'concat'
  48. 'uglify'
  49. ]