@@ -2,36 +2,51 @@ module.exports = function(grunt) {
22 "use strict" ;
33
44 grunt . initConfig ( {
5- pkg : grunt . file . readJSON ( 'package.json' ) ,
5+ pkg : grunt . file . readJSON ( "package.json" ) ,
6+ meta : {
7+ banner : "/*\n" +
8+ " * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n" +
9+ " * <%= pkg.description %>\n" +
10+ " * <%= pkg.homepage %>\n" +
11+ " *\n" +
12+ " * Made by <%= pkg.author.name %>\n" +
13+ " * Under <%= pkg.licenses[0].type %> License (<%= pkg.licenses[0].url %>)\n" +
14+ " */\n"
15+ } ,
616 jshint : {
7- all : [ "jquery.maskMoney.js" , "Gruntfile.js" ] ,
17+ all : [ "src/ jquery.maskMoney.js" , "Gruntfile.js" ] ,
818 options : {
9- globals : {
10- bitwise : true ,
11- jQuery : true ,
12- console : true ,
13- module : true
14- }
19+ jshintrc : true
1520 }
1621 } ,
22+ concat : {
23+ dist : {
24+ src : [ "src/jquery.maskMoney.js" ] ,
25+ dest : "dist/jquery.maskMoney.js"
26+ } ,
27+ options : {
28+ banner : "<%= meta.banner %>"
29+ }
30+ } ,
1731 uglify : {
1832 options : {
19- banner : '/*\n <%= pkg.description %>\n version: <%= pkg.version %>\n <%= pkg.homepage %>\n Copyright (c) 2009 - <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n Licensed under the MIT license (https://github.com/plentz/jquery-maskmoney/blob/master/LICENSE)\n*/\n' ,
20- preserveComments : false ,
33+ banner : "<%= meta.banner %>" ,
2134 mangle : {
2235 except : [ "jQuery" , "$" ]
2336 }
2437 } ,
2538 build : {
2639 files : [
27- { src : "jquery.maskMoney.js" , dest : "jquery.maskMoney.min.js" } ,
40+ { src : "src/ jquery.maskMoney.js" , dest : "dist/ jquery.maskMoney.min.js" } ,
2841 ]
2942 }
3043 }
3144 } ) ;
3245
46+ grunt . loadNpmTasks ( "grunt-contrib-concat" ) ;
3347 grunt . loadNpmTasks ( "grunt-contrib-jshint" ) ;
3448 grunt . loadNpmTasks ( "grunt-contrib-uglify" ) ;
3549
36- grunt . registerTask ( "default" , [ "jshint" , "uglify" ] ) ;
50+ grunt . registerTask ( "default" , [ "jshint" , "concat" , "uglify" ] ) ;
51+ grunt . registerTask ( "travis" , [ "jshint" ] ) ;
3752} ;
0 commit comments