1+ module . exports = function ( grunt ) {
2+ grunt . initConfig ( {
3+ pkg : grunt . file . readJSON ( 'package.json' ) ,
4+
5+ browserify : {
6+ dev : {
7+ options : {
8+ prepend : [ '/*! binarypack.js build:<%= pkg.version %>, development. ' +
9+ 'Copyright(c) 2012 Eric Zhang <eric@ericzhang.com> MIT Licensed */' ]
10+ } ,
11+ src : [ 'lib/exports.js' ] ,
12+ dest : 'dist/binarypack.js'
13+ }
14+ } ,
15+
16+ uglify : {
17+ prod : {
18+ options : {
19+ mangle : true , compress : true ,
20+ } ,
21+ src : 'dist/binarypack.js' ,
22+ dest : 'dist/binarypack.min.js'
23+ }
24+ } ,
25+
26+ concat : {
27+ dev : {
28+ options : {
29+ banner : '/*! binarypack.js build:<%= pkg.version %>, production. ' +
30+ 'Copyright(c) 2012 Eric Zhang <eric@ericzhang.com> MIT Licensed */'
31+ } ,
32+ src : 'dist/binarypack.js' ,
33+ dest : 'dist/binarypack.js' ,
34+ } ,
35+ prod : {
36+ options : {
37+ banner : '/*! binarypack.js build:<%= pkg.version %>, production. ' +
38+ 'Copyright(c) 2012 Eric Zhang <eric@ericzhang.com> MIT Licensed */'
39+ } ,
40+ src : 'dist/binarypack.min.js' ,
41+ dest : 'dist/binarypack.min.js' ,
42+ }
43+ }
44+ } ) ;
45+
46+ grunt . loadNpmTasks ( 'grunt-browserify' ) ;
47+ grunt . loadNpmTasks ( 'grunt-contrib-uglify' ) ;
48+ grunt . loadNpmTasks ( 'grunt-contrib-concat' ) ;
49+
50+ grunt . registerTask ( 'default' , [ 'browserify' , 'uglify' , 'concat' ] ) ;
51+ }
0 commit comments