Gruntfile.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. module.exports = function (grunt) {
  2. function createBanner() {
  3. return '/*\n' +
  4. '* <%= pkg.name %>\n' +
  5. '* http://github.com/RobinHerbots/jquery.inputmask\n' +
  6. '* Copyright (c) 2010 - <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
  7. '* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n' +
  8. '* Version: <%= pkg.version %>\n' +
  9. '*/\n';
  10. }
  11. // Project configuration.
  12. grunt.initConfig({
  13. pkg: grunt.file.readJSON('package.json'),
  14. uglify: {
  15. options: {
  16. banner: createBanner()
  17. },
  18. inputmask: {
  19. files: {
  20. 'dist/inputmask/<%= pkg.name %>.js': 'js/<%= pkg.name %>.js',
  21. 'dist/inputmask/<%= pkg.name %>.extensions.js': 'js/<%= pkg.name %>.extensions.js',
  22. 'dist/inputmask/<%= pkg.name %>.date.extensions.js': 'js/<%= pkg.name %>.date.extensions.js',
  23. 'dist/inputmask/<%= pkg.name %>.numeric.extensions.js': 'js/<%= pkg.name %>.numeric.extensions.js',
  24. 'dist/inputmask/<%= pkg.name %>.phone.extensions.js': 'js/<%= pkg.name %>.phone.extensions.js',
  25. 'dist/inputmask/<%= pkg.name %>.regex.extensions.js': 'js/<%= pkg.name %>.regex.extensions.js',
  26. }
  27. },
  28. inputmaskbundle: {
  29. files: {
  30. 'dist/<%= pkg.name %>.bundle.js': [
  31. 'js/<%= pkg.name %>.js',
  32. 'js/<%= pkg.name %>.extensions.js',
  33. 'js/<%= pkg.name %>.date.extensions.js',
  34. 'js/<%= pkg.name %>.numeric.extensions.js',
  35. 'js/<%= pkg.name %>.phone.extensions.js',
  36. 'js/<%= pkg.name %>.regex.extensions.js'
  37. ]
  38. }
  39. }
  40. },
  41. clean: ["dist"],
  42. qunit: {
  43. files: ['qunit/qunit.html']
  44. }
  45. });
  46. // Load the plugin that provides the tasks.
  47. grunt.loadNpmTasks('grunt-contrib-uglify');
  48. grunt.loadNpmTasks('grunt-contrib-clean');
  49. grunt.loadNpmTasks('grunt-contrib-qunit');
  50. // Default task(s).
  51. grunt.registerTask('default', ['clean', 'uglify']);
  52. };