From 9246df4410ad9a74f6d0c10b1abbcc43a7fcca97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Westr=C3=B6m?= Date: Sun, 11 Jan 2015 16:16:18 +0100 Subject: [PATCH] Break out dagre-d3 dependency --- gulpfile.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 6d77a3d5e..9a3d134fb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -68,11 +68,22 @@ gulp.task('less', function () { var browserify = require('gulp-browserify'); +var slim_ext_libs = [ + 'dagre-d3', + 'd3' +]; + // Basic usage gulp.task('slimDist', function() { // Single entry point to browserify return gulp.src('src/main.js') - .pipe(browserify()) + .pipe(browserify({standalone: 'mermaid'})) + .on('prebundle', function(bundle) { + // Keep these external for the slim version. + slim_ext_libs.forEach(function(lib) { + bundle.external(lib); + }); + }) .pipe(rename('mermaid.slim.js')) .pipe(gulp.dest('./dist/')) .pipe(uglify())