Skip to content

Commit

Permalink
Merge pull request #72 from kevcenteno/gruntMin
Browse files Browse the repository at this point in the history
Added "grunt build" task to create minified version
  • Loading branch information
mihai-vlc committed Jan 13, 2014
2 parents 427b18c + aec1fce commit 46b271f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.DS_Store
dist
23 changes: 23 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

qunit: {
files: ['test/index.html']
},

uglify: {
options: {
banner: '/*!\n' +
'* <%= pkg.name %> JavaScript Library v<%= pkg.version %>\n' +
'* <%= pkg.homepage %>\n' +
'*\n' +
'*\n' +
'* Released under the <%= pkg.license.type %> license\n' +
'* <%= pkg.license.url %>\n' +
'*\n' +
'* Date: <%= grunt.template.today("yyyy-mm-dd") %>\n' +
'*\n' +
'*/\n'
},
dist: {
files: {'dist/<%= pkg.name %>.min.js' : ['<%= pkg.name %>.js']}
}
}
});

grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.registerTask('test', 'qunit');
grunt.registerTask('default', ['qunit']);
grunt.registerTask('build', ['qunit', 'uglify']);
};
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ var VerEx = require("verbal-expressions");
(or)
$ grunt test

## Creating a minified version

This will generate a minified version of VerbalExpressions.js (aptly named VerbalExpressions.min.js) in a _dist_ folder.

$ grunt build

## Examples

Here's a couple of simple examples to give an idea of how VerbalExpressions works:
Expand Down
2 changes: 1 addition & 1 deletion VerbalExpressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
*
* Released under the MIT license
* http://jquery.org/license
* http://opensource.org/licenses/MIT
*
* Date: 2013-07-19
*
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "verbal-expressions",
"name": "VerbalExpressions",
"description": "JavaScript Regular expressions made easy",
"version": "0.1.2",
"keywords": [ "regular expressions", "regex" ],
"homepage": "https://github.com/VerbalExpressions/JSVerbalExpressions",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-qunit": "~0.2.2"
"grunt-contrib-qunit": "~0.2.2",
"grunt-contrib-uglify": "~0.2.2"
},
"repository": {
"type": "git",
Expand All @@ -15,7 +17,10 @@
"url": "https://github.com/VerbalExpressions/JSVerbalExpressions/issues"
},
"main": "VerbalExpressions.js",
"license": "MIT",
"license": {
"type": "MIT",
"url": "http://opensource.org/licenses/MIT"
},
"engines": {
"node": ">= 0.8.0"
}
Expand Down

0 comments on commit 46b271f

Please sign in to comment.