module.exports = function (grunt) { 'use strict'; // Project configuration grunt.initConfig({ // Metadata pkg: grunt.file.readJSON('package.json'), banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + '<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' + ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;' + ' Licensed <%= pkg.license %> */\n', // Task configuration concat: { options: { banner: '<%= banner %>', stripBanners: true }, dist: { src: ['<%= pkg.name %>.js'], dest: 'dist/<%= pkg.name %>.js' } }, uglify: { options: { banner: '<%= banner %>' }, dist: { src: '<%= concat.dist.dest %>', dest: 'dist/<%= pkg.name %>.min.js' } }, jshint: { options: { node: true, curly: false, eqeqeq: true, immed: true, latedef: true, newcap: true, noarg: true, sub: true, undef: true, unused: true, eqnull: true, boss: true }, gruntfile: { src: 'Gruntfile.js' }, main: { src: '<%= pkg.name %>.js' } }, watch: { gruntfile: { files: '<%= jshint.gruntfile.src %>', tasks: ['jshint:gruntfile'] }, main: { files: '<%= jshint.main.src %>', tasks: ['jshint:main'] } } }); // These plugins provide necessary tasks grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); // Default task grunt.registerTask('default', ['jshint:main', 'concat', 'uglify']); };