From de23698414d00cb86deb387a8c7df4c1c263c5c6 Mon Sep 17 00:00:00 2001 From: Andrea Verlicchi Date: Wed, 19 Mar 2014 16:31:28 +0100 Subject: [PATCH] Added gruntfile --- Gruntfile.js | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Gruntfile.js diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..11aa044 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,70 @@ +/*global module:false*/ +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + // Metadata. + meta: { + version: '2.0.3' + }, + banner: '/*! picturePolyfill - v<%= meta.version %> - ' + + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + + '* https://github.com/verlok/picturePolyfill/\n' + + '* Copyright (c) <%= grunt.template.today("yyyy") %> ' + + 'Andrea "verlok" Verlicchi; Licensed MIT */\n', + // Task configuration. + uglify: { + options: { + banner: '<%= banner %>' + }, + dist: { + src: 'picturePolyfill.js', + dest: 'picturePolyfill.min.js' + } + }, + jshint: { + options: { + curly: true, + eqeqeq: true, + immed: true, + latedef: true, + newcap: true, + noarg: true, + sub: true, + undef: true, + unused: true, + boss: true, + eqnull: true, + browser: true, + globals: { + jQuery: true + } + }, + gruntfile: { + src: 'Gruntfile.js' + }, + lib: { + src: ['<%= uglify.dist.src %>'] + } + }, + watch: { + gruntfile: { + files: '<%= jshint.gruntfile.src %>', + tasks: ['jshint:gruntfile'] + }, + lib: { + files: '<%= jshint.lib.src %>', + tasks: ['jshint:lib', 'uglify'] + } + } + }); + + // These plugins provide necessary tasks. + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + + // Default task. + grunt.registerTask('default', ['jshint', 'uglify']); + +};