Skip to content

Commit 77551b1

Browse files
committed
use grunt for jshint and uglify
1 parent 2204149 commit 77551b1

File tree

4 files changed

+39
-6
lines changed

4 files changed

+39
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/npm-debug.log
2+
/build
3+
/node_modules

.jshintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
"regexp": true,
1616
"strict": false,
1717
"trailing": true,
18-
"unused": true
19-
}
18+
"unused": true,
19+
"globals": { "define": true }
20+
}

Gruntfile.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = function(grunt) {
2+
3+
// Project configuration.
4+
grunt.initConfig({
5+
pkg: grunt.file.readJSON('package.json'),
6+
uglify: {
7+
options: {
8+
preserveComments: 'some'
9+
},
10+
build: {
11+
src: '<%= pkg.name %>.js',
12+
dest: 'build/<%= pkg.name %>.min.js'
13+
}
14+
},
15+
jshint: {
16+
all: ['*.js']
17+
}
18+
});
19+
20+
// Load the plugin that provides the "uglify" task.
21+
grunt.loadNpmTasks('grunt-contrib-uglify');
22+
grunt.loadNpmTasks('grunt-contrib-jshint');
23+
24+
// Default task(s).
25+
grunt.registerTask('default', ['jshint', 'uglify']);
26+
27+
};

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
2-
"scripts": {
3-
"check": "jshint .",
4-
"lint": "jshint ."
2+
"name" : "jquery.mousewheel",
3+
"version": "3.1.1",
4+
"devDependencies": {
5+
"grunt-contrib-jshint": "~0.2.0",
6+
"grunt-contrib-uglify": "~0.1.2",
7+
"grunt": "~0.4.0"
58
}
6-
}
9+
}

0 commit comments

Comments
 (0)