diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-11-01 15:09:58 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-11-01 15:09:58 +0100 |
commit | c4540332a7c43a0d7c9315c029e60bd0d3aaebf3 (patch) | |
tree | 746949fc2a5bfc3e1c721dc9953fee38a9f5137a /Gruntfile.js | |
parent | 2104404cb36d6916fce4c811cc4059ba644720e4 (diff) | |
download | gitbook-c4540332a7c43a0d7c9315c029e60bd0d3aaebf3.zip gitbook-c4540332a7c43a0d7c9315c029e60bd0d3aaebf3.tar.gz gitbook-c4540332a7c43a0d7c9315c029e60bd0d3aaebf3.tar.bz2 |
Bundle gitbook parser as a client side library
Diffstat (limited to 'Gruntfile.js')
-rw-r--r-- | Gruntfile.js | 35 |
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 |