use grunt for jshint and uglify

This commit is contained in:
Brandon Aaron
2013-03-11 21:17:08 -05:00
parent 22041497ff
commit 77551b1a94
4 changed files with 39 additions and 6 deletions
+2
View File
@@ -1 +1,3 @@
/npm-debug.log
/build
/node_modules
+3 -2
View File
@@ -15,5 +15,6 @@
"regexp": true,
"strict": false,
"trailing": true,
"unused": true
}
"unused": true,
"globals": { "define": true }
}
+27
View File
@@ -0,0 +1,27 @@
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
preserveComments: 'some'
},
build: {
src: '<%= pkg.name %>.js',
dest: 'build/<%= pkg.name %>.min.js'
}
},
jshint: {
all: ['*.js']
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
// Default task(s).
grunt.registerTask('default', ['jshint', 'uglify']);
};
+7 -4
View File
@@ -1,6 +1,9 @@
{
"scripts": {
"check": "jshint .",
"lint": "jshint ."
"name" : "jquery.mousewheel",
"version": "3.1.1",
"devDependencies": {
"grunt-contrib-jshint": "~0.2.0",
"grunt-contrib-uglify": "~0.1.2",
"grunt": "~0.4.0"
}
}
}