Gruntfile.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*global module:false*/
  2. module.exports = function(grunt){
  3. // Project configuration.
  4. grunt.initConfig({
  5. pkg: grunt.file.readJSON('package.json'),
  6. bower: grunt.file.readJSON('bower.json'),
  7. copy: {
  8. demo: {
  9. files: [
  10. {expand: true, src: ['src/*'], dest: 'dist/', filter: 'isFile', flatten: true}
  11. ]
  12. }
  13. },
  14. uglify: {
  15. options: {
  16. beautify: {
  17. ascii_only : true
  18. },
  19. preserveComments: 'some'
  20. },
  21. html5shiv: {
  22. files: [{
  23. expand: true, // Enable dynamic expansion.
  24. cwd: 'src/', // Src matches are relative to this path.
  25. src: ['**/*.js'], // Actual pattern(s) to match.
  26. dest: 'dist/', // Destination path prefix.
  27. ext: '.min.js'
  28. }]
  29. }
  30. },
  31. watch: {
  32. js: {
  33. files: ['src/**/*.js'],
  34. tasks: ['copy', 'uglify', 'bytesize']
  35. }
  36. },
  37. bytesize: {
  38. all: {
  39. src: [
  40. 'dist/**.min.js'
  41. ]
  42. }
  43. }
  44. });
  45. // Default task.
  46. grunt.loadNpmTasks('grunt-contrib-copy');
  47. grunt.loadNpmTasks('grunt-contrib-uglify');
  48. grunt.loadNpmTasks('grunt-contrib-watch');
  49. grunt.loadNpmTasks('grunt-bytesize');
  50. grunt.registerTask('default', ['copy', 'uglify', 'bytesize', 'watch']);
  51. };