Gruntfile.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. module.exports = function( grunt ) {
  2. grunt.initConfig({
  3. component_build: {
  4. dev: {
  5. output: './dist/',
  6. name: 'seed',
  7. dev: true,
  8. sourceUrls: true,
  9. styles: false,
  10. verbose: true
  11. },
  12. build: {
  13. output: './dist/',
  14. name: 'seed',
  15. styles: false
  16. }
  17. },
  18. jshint: {
  19. build: {
  20. src: ['src/**/*.js'],
  21. options: {
  22. jshintrc: "./.jshintrc"
  23. }
  24. }
  25. },
  26. mocha: {
  27. build: {
  28. src: ['test/test.html'],
  29. options: {
  30. reporter: 'Spec',
  31. run: true
  32. }
  33. }
  34. },
  35. uglify: {
  36. build: {
  37. options: {
  38. compress: true,
  39. mangle: true
  40. },
  41. files: {
  42. 'dist/seed.min.js': 'dist/seed.js'
  43. }
  44. }
  45. },
  46. watch: {
  47. options: {
  48. livereload: true
  49. },
  50. component: {
  51. files: ['src/**/*.js', 'component.json'],
  52. tasks: 'component_build:dev'
  53. }
  54. }
  55. })
  56. grunt.loadNpmTasks( 'grunt-contrib-watch' )
  57. grunt.loadNpmTasks( 'grunt-contrib-jshint' )
  58. grunt.loadNpmTasks( 'grunt-contrib-uglify' )
  59. grunt.loadNpmTasks( 'grunt-component-build' )
  60. grunt.loadNpmTasks( 'grunt-mocha' )
  61. grunt.registerTask( 'test', ['mocha'] )
  62. grunt.registerTask( 'default', ['jshint', 'component_build:build', 'uglify'] )
  63. }