Gruntfile.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. stripBanners: true,
  20. banner: '<%= banner %>'
  21. },
  22. dist: {
  23. src: ['src/js/bootstrapvalidate.js', 'src/js/validator/*.js'],
  24. dest: '<%= buildDir %>/js/bootstrapvalidate.js'
  25. }
  26. },
  27. uglify: {
  28. options: {
  29. banner: '<%= banner %>'
  30. },
  31. build: {
  32. src: ['<%= buildDir %>/js/bootstrapvalidate.js'],
  33. dest: '<%= buildDir %>/js/bootstrapvalidate.min.js'
  34. }
  35. }
  36. });
  37. grunt.registerTask('default', 'build');
  38. grunt.registerTask('build', ['concat', 'uglify']);
  39. grunt.loadNpmTasks('grunt-contrib-concat');
  40. grunt.loadNpmTasks('grunt-contrib-uglify');
  41. };