From c8d72235c87cef5e207413ccc21bcb8e2776bb7c Mon Sep 17 00:00:00 2001 From: "Yuxuan (Tim) Hong" Date: Thu, 9 Feb 2017 10:23:00 +1300 Subject: [PATCH] feat(docs): use babel preset2015 for custom builds (#2678) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 977df78a..a61f1bd9 100644 --- a/README.md +++ b/README.md @@ -192,8 +192,8 @@ exports.Timeline = require('./lib/timeline/Timeline'); Then create a custom bundle using browserify, like: - $ browserify custom.js -t babelify -o dist/vis-custom.js -s vis - + $ browserify custom.js -t [ babelify --presets [es2015] ] -o dist/vis-custom.js -s vis + This will generate a custom bundle *vis-custom.js*, which exposes the namespace `vis` containing only `DataSet` and `Timeline`. The generated bundle can be minified using uglifyjs: $ uglifyjs dist/vis-custom.js -o dist/vis-custom.min.js @@ -217,7 +217,7 @@ The custom bundle can now be loaded like: The default bundle `vis.js` is standalone and includes external dependencies such as *hammer.js* and *moment.js*. When these libraries are already loaded by the application, vis.js does not need to include these dependencies itself too. To build a custom bundle of vis.js excluding *moment.js* and *hammer.js*, run browserify in the root of the project: - $ browserify index.js -t babelify -o dist/vis-custom.js -s vis -x moment -x hammerjs + $ browserify index.js -t [ babelify --presets [es2015] ] -o dist/vis-custom.js -s vis -x moment -x hammerjs This will generate a custom bundle *vis-custom.js*, which exposes the namespace `vis`, and has *moment.js* and *hammer.js* excluded. The generated bundle can be minified with uglifyjs: