From aa74d7f1c60705b80ab8897b408b24d55b087746 Mon Sep 17 00:00:00 2001 From: Jamie Nguyen <j@jamielinux.com> Date: Wed, 10 Jul 2013 19:47:59 +0100 Subject: [PATCH] Update Gruntfile.js for use with grunt 0.4.0 --- Gruntfile.js | 38 +++++++++++++++++++++----------------- package.json | 6 +++++- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 09bd528..144d14e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,24 +5,23 @@ module.exports = function(grunt) { pkg: '<json:package.json>', meta: { name: 'JavaScript Hooker', - banner: '/*! <%= meta.name %> - v<%= pkg.version %> - <%= grunt.template.today("m/d/yyyy") %>\n' + - '* <%= pkg.homepage %>\n' + - '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + - ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' }, - concat: { - dist: { - src: ['<banner>', '<file_strip_banner:lib/hooker.js>'], - dest: 'dist/ba-hooker.js' - } - }, - min: { + uglify: { + options: { + banner: '/*\n' + + ' * Javascript Hooker\n' + + ' * http://github.com/cowboy/javascript-hooker\n' + + ' * Copyright (c) 2012 "Cowboy" Ben Alman\n' + + ' * Licensed under the MIT license.\n' + + ' */\n' + }, dist: { - src: ['<banner>', 'dist/ba-hooker.js'], - dest: 'dist/ba-hooker.min.js' + files: { + 'dist/ba-hooker.min.js': 'dist/ba-hooker.js' + } } }, - test: { + nodeunit: { files: ['test/**/*.js'] }, lint: { @@ -30,7 +29,7 @@ module.exports = function(grunt) { }, watch: { files: '<config:lint.files>', - tasks: 'lint:files test:files' + tasks: 'lint:files nodeunit:files' }, jshint: { options: { @@ -50,10 +49,15 @@ module.exports = function(grunt) { module: false } }, - uglify: {} }); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-nodeunit'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-watch'); + // Default task. - grunt.registerTask('default', 'lint test concat min'); + grunt.registerTask('default', ['lint nodeunit uglify']); + grunt.registerTask('test', ['lint nodeunit']); }; diff --git a/package.json b/package.json index 6dd6968..1bde458 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,11 @@ ], "dependencies": {}, "devDependencies": { - "grunt": "~0.2.1" + "grunt": "~0.2.1", + "grunt-contrib-jshint": "~0.6.0", + "grunt-contrib-nodeunit": "~0.2.0", + "grunt-contrib-uglify": "~0.2.2", + "grunt-contrib-watch": "~0.4.4" }, "keywords": [ "patch", -- 1.8.3.1