Skip to content

Commit af2b8f2

Browse files
committed
Merge pull request #6 from lmb/master
Use browserify to build distribution
2 parents 22e161e + 32feccf commit af2b8f2

File tree

11 files changed

+80
-805
lines changed

11 files changed

+80
-805
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
node_modules/

.npmignore

Whitespace-only changes.

Gruntfile.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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 <[email protected]> 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 <[email protected]> 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 <[email protected]> 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+
}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
default: compress
22

33
compress:
4-
@node bin/build.js;
4+
@./node_modules/.bin/grunt

bin/build.js

Lines changed: 0 additions & 211 deletions
This file was deleted.

0 commit comments

Comments
 (0)