GruntFile.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. module.exports = function(grunt) {
  2. // Project configuration.
  3. grunt.initConfig({
  4. pkg: grunt.file.readJSON('package.json'),
  5. uglify: {
  6. options: {
  7. banner: '/*!\n' +
  8. ' * <%= pkg.name %> v<%= pkg.version %> ' +
  9. '(<%= grunt.template.today("yyyy-mm-dd") %>)\n' +
  10. ' * <%= pkg.homepage %>\n' +
  11. ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
  12. ' Licensed <%= pkg.license %>\n' +
  13. '*/'
  14. },
  15. files: {
  16. expand: true,
  17. cwd: 'src',
  18. src: ['**/*.js'],
  19. dest: 'dist',
  20. rename: function (dst, src) {
  21. return dst + '/' + src.replace('.js', '.min.js');
  22. }
  23. }
  24. }
  25. });
  26. // Load the plugin that provides the "uglify" task.
  27. grunt.loadNpmTasks('grunt-contrib-uglify');
  28. // Default task(s).
  29. grunt.registerTask('default', ['uglify']);
  30. };