Gruntfile.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. module.exports = function(grunt) {
  2. grunt.initConfig({
  3. pkg: grunt.file.readJSON('package.json'),
  4. buildDir: 'dist',
  5. banner: [
  6. '/**',
  7. ' * BootstrapValidate v<%= pkg.version %> (<%= pkg.homepage %>)',
  8. ' *',
  9. ' * A jQuery plugin to validate form fields. Use with Bootstrap 3',
  10. ' *',
  11. ' * @author Nguyen Huu Phuoc <phuoc@huuphuoc.me>',
  12. ' * @copyright (c) 2013 Nguyen Huu Phuoc',
  13. ' * @license MIT',
  14. ' */\n\n'
  15. ].join('\n'),
  16. concat: {
  17. options: {
  18. separator: ';'
  19. },
  20. dist: {
  21. src: ['src/js/bootstrapvalidate.js', 'src/js/validator/*.js'],
  22. dest: '<%= buildDir %>/js/bootstrapvalidate.js'
  23. }
  24. },
  25. uglify: {
  26. options: {
  27. banner: '<%= banner %>'
  28. },
  29. build: {
  30. src: ['<%= buildDir %>/js/bootstrapvalidate.js'],
  31. dest: '<%= buildDir %>/js/bootstrapvalidate.min.js'
  32. }
  33. }
  34. });
  35. grunt.registerTask('default', 'build');
  36. grunt.registerTask('build', ['concat', 'uglify']);
  37. grunt.loadNpmTasks('grunt-contrib-concat');
  38. grunt.loadNpmTasks('grunt-contrib-uglify');
  39. };