summaryrefslogtreecommitdiffstats
path: root/Gruntfile.js
diff options
context:
space:
mode:
authorcodepiano <codepiano.li@gmail.com>2014-11-02 01:34:28 +0800
committercodepiano <codepiano.li@gmail.com>2014-11-02 01:34:28 +0800
commit1502d65286eb36a76b8d0016f7bad64b9bf9f39f (patch)
treef954a62a351413faef03818b49d92a6312d5e4df /Gruntfile.js
parent9da10e2b25cb8ad919bb8563cfdc81d9e0612341 (diff)
parent0feb672d708e2d73ee159d5a94b614f90c85e9e2 (diff)
downloadgitbook-1502d65286eb36a76b8d0016f7bad64b9bf9f39f.zip
gitbook-1502d65286eb36a76b8d0016f7bad64b9bf9f39f.tar.gz
gitbook-1502d65286eb36a76b8d0016f7bad64b9bf9f39f.tar.bz2
Merge branch 'master' of github.com:GitbookIO/gitbook into fork
Conflicts: lib/parse/page.js
Diffstat (limited to 'Gruntfile.js')
-rw-r--r--Gruntfile.js35
1 files changed, 34 insertions, 1 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 51c4f94..ad2f622 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -6,6 +6,8 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks("grunt-bower-install-simple");
+ grunt.loadNpmTasks('grunt-browserify');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
// Init GRUNT configuraton
grunt.initConfig({
@@ -77,6 +79,30 @@ module.exports = function (grunt) {
}
]
}
+ },
+ browserify: {
+ dist: {
+ files: {
+ 'gitbook.js': [
+ './lib/parse/index.js'
+ ],
+ },
+ options: {
+ postBundleCB: function (err, src, next) {
+ return next(null, '(function () { var define = undefined; '+src+'; })();')
+ },
+ browserifyOptions: {
+ 'standalone': "gitbook"
+ }
+ }
+ }
+ },
+ uglify: {
+ dist: {
+ files: {
+ 'gitbook.min.js': ['gitbook.js']
+ }
+ }
}
});
@@ -90,7 +116,14 @@ module.exports = function (grunt) {
'copy:vendors'
]);
+ // Bundle the library
+ grunt.registerTask('bundle', [
+ 'bower-install',
+ 'uglify'
+ ]);
+
grunt.registerTask('default', [
- 'build'
+ 'build',
+ 'bundle'
]);
}; \ No newline at end of file