Skip to content

Commit

Permalink
Merge pull request #2 from dertseha/grunt_build
Browse files Browse the repository at this point in the history
Created Grunt.js based build
  • Loading branch information
janantala committed Oct 22, 2013
2 parents 1bfede9 + e025a84 commit 1fc5e5f
Show file tree
Hide file tree
Showing 20 changed files with 2,870 additions and 1,319 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules/
17 changes: 17 additions & 0 deletions .jsbeautifyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"indent_size": 2,
"indent_char": " ",
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 4,
"space_in_paren": false,
"jslint_happy": false,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": false,
"eval_code": false,
"unescape_strings": false,
"break_chained_methods": false,
"e4x": false,
"wrap_line_length": 0
}
15 changes: 15 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"camelcase": true,
"curly": true,
"eqeqeq": true,
"latedef": true,
"quotmark": "double",
"undef": true,
"maxparams": 5,
"maxdepth": 5,

"globals": {
"require": true,
"module": true
}
}
58 changes: 58 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
var path = require("path");

module.exports = function(grunt) {
"use strict";
var jsFiles = ["Gruntfile.js", "src/**/*.js"];

grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),

// Run JSHint on all sources
jshint: {
options: {
jshintrc: "./.jshintrc"
},
all: jsFiles
},

// JSBeautifier on all sources
jsbeautifier: {
standard: {
src: jsFiles,
options: {
js: grunt.file.readJSON(".jsbeautifyrc")
}
}
},

// browserify for packing all commonjs files
browserify: {
client: {
src: ["src/QRCode.js"],
dest: "lib/qrcode.js",
options: {
standalone: "QRCode"
}
}
},

// uglify for compression
uglify: {
lib: {
files: {
"lib/qrcode.min.js": ["lib/qrcode.js"]
}
}
}
});

grunt.loadNpmTasks("grunt-browserify");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-jsbeautifier");

grunt.registerTask("lint", ["jshint", "jsbeautifier"]);
grunt.registerTask("compile", ["browserify", "uglify"]);

grunt.registerTask("default", ["lint", "compile"]);
};
Loading

0 comments on commit 1fc5e5f

Please sign in to comment.