Skip to content

Commit 66fc908

Browse files
committed
Merge branch 'fork'
Conflicts: lib/parse/page.js
2 parents 9630dbf + 1502d65 commit 66fc908

File tree

13 files changed

+20806
-53
lines changed

13 files changed

+20806
-53
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Release notes
22

3+
## 1.3.0
4+
- Bundle gitbook parsing library as a client side library in `gitbook.js` and `gitbook.min.js`
5+
36
## 1.2.0
47
- Improvements on ebook generation
58
- Fix incorrect follow of links in ebook generation

Gruntfile.js

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ module.exports = function (grunt) {
66
grunt.loadNpmTasks('grunt-contrib-less');
77
grunt.loadNpmTasks('grunt-contrib-requirejs');
88
grunt.loadNpmTasks("grunt-bower-install-simple");
9+
grunt.loadNpmTasks('grunt-browserify');
10+
grunt.loadNpmTasks('grunt-contrib-uglify');
911

1012
// Init GRUNT configuraton
1113
grunt.initConfig({
@@ -77,6 +79,30 @@ module.exports = function (grunt) {
7779
}
7880
]
7981
}
82+
},
83+
browserify: {
84+
dist: {
85+
files: {
86+
'gitbook.js': [
87+
'./lib/parse/index.js'
88+
],
89+
},
90+
options: {
91+
postBundleCB: function (err, src, next) {
92+
return next(null, '(function () { var define = undefined; '+src+'; })();')
93+
},
94+
browserifyOptions: {
95+
'standalone': "gitbook"
96+
}
97+
}
98+
}
99+
},
100+
uglify: {
101+
dist: {
102+
files: {
103+
'gitbook.min.js': ['gitbook.js']
104+
}
105+
}
80106
}
81107
});
82108

@@ -90,7 +116,14 @@ module.exports = function (grunt) {
90116
'copy:vendors'
91117
]);
92118

119+
// Bundle the library
120+
grunt.registerTask('bundle', [
121+
'bower-install',
122+
'uglify'
123+
]);
124+
93125
grunt.registerTask('default', [
94-
'build'
126+
'build',
127+
'bundle'
95128
]);
96129
};

0 commit comments

Comments
 (0)