Gruntfile.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. 'use strict';
  2. module.exports = function(grunt) {
  3. // Project configuration.
  4. grunt.initConfig({
  5. // Metadata.
  6. pkg: grunt.file.readJSON('bootstrap-table.jquery.json'),
  7. banner: '/*\n' +
  8. '* <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
  9. '<%= pkg.homepage ? "* " + pkg.homepage : "" %>\n' +
  10. '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
  11. '* Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n' +
  12. '*/\n',
  13. // Task configuration.
  14. clean: ['dist'],
  15. uglify: {
  16. options: {
  17. banner: '<%= banner %>'
  18. },
  19. my_target: {
  20. files: {
  21. 'dist/<%= pkg.name %>.min.js': ['src/<%=pkg.name %>.js']
  22. }
  23. },
  24. locale_target: {
  25. files: [{
  26. expand: true,
  27. cwd: 'src/locale',
  28. src: '**/*.js',
  29. dest: 'dist/locale'
  30. }]
  31. }
  32. },
  33. cssmin: {
  34. add_banner: {
  35. options: {
  36. banner: '<%= banner %>'
  37. },
  38. files: {
  39. 'dist/<%= pkg.name %>.min.css': ['src/<%=pkg.name %>.css']
  40. }
  41. }
  42. }
  43. });
  44. grunt.loadNpmTasks('grunt-contrib-clean');
  45. grunt.loadNpmTasks('grunt-contrib-uglify');
  46. grunt.loadNpmTasks('grunt-contrib-cssmin');
  47. grunt.registerTask('default', ['clean', 'uglify', 'cssmin']);
  48. };