Permalink
Browse files

Add a grunt task to browserify JSHint

Since I'm writing JSHint Next as a node program we need a way to
run it in (modern) browsers. Browserify to the rescue!
  • Loading branch information...
1 parent 2b3c9e9 commit dba6622c3ba2bb4d209ecc8097a836c257c48265 @valueof valueof committed Jun 18, 2012
Showing with 15 additions and 5 deletions.
  1. +1 −0 .gitignore
  2. +9 −1 grunt.js
  3. +5 −4 package.json
View
@@ -1,2 +1,3 @@
node_modules/*
TODO
+dist/*
View
@@ -1,5 +1,4 @@
module.exports = function (grunt) {
- // Project configuration.
grunt.initConfig({
lint: {
all: [ "src/**/*.js" ]
@@ -22,4 +21,13 @@ module.exports = function (grunt) {
});
grunt.registerTask("default", "lint test");
+
+ grunt.registerTask("browserify", "Builds a browserified copy of JSHint", function () {
+ var browserify = require("browserify");
+ var bundle = browserify({ debug: true });
+
+ bundle.addEntry("./src/jshint.js");
+ grunt.file.mkdir("./dist");
+ grunt.file.write("./dist/jshint.js", bundle.bundle());
+ });
};
View
@@ -8,9 +8,10 @@
},
"devDependencies": {
- "coveraje": "*",
- "grunt": "*",
- "nodeunit": "*",
- "jshint": "*"
+ "browserify": "*",
+ "coveraje": "*",
+ "grunt": "*",
+ "nodeunit": "*",
+ "jshint": "*"
}
}

0 comments on commit dba6622

Please sign in to comment.