From e881a78462f996290f8ca9e7332b2801a49d0f62 Mon Sep 17 00:00:00 2001 From: jos Date: Tue, 14 Apr 2015 17:03:35 +0200 Subject: [PATCH] replaced `6to5` with `babel`, letting webpack output errors, minor fix --- README.md | 4 ++-- gulpfile.js | 8 +++++--- lib/network/modules/components/edges/BezierEdgeDynamic.js | 2 +- lib/timeline/component/graph2d_types/points.js | 2 +- package.json | 8 ++++---- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2d397abb..1c89f260 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ exports.Timeline = require('./lib/timeline/Timeline'); Install browserify globally via `[sudo] npm install -g browserify`, then create a custom bundle like: - browserify custom.js -t 6to5ify -o vis-custom.js -s vis + browserify custom.js -t babelify -o 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 with uglifyjs (installed globally with `[sudo] npm install -g uglify-js`): @@ -204,7 +204,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 6to5ify -o vis-custom.js -s vis -x moment -x hammerjs + browserify index.js -t babelify -o 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 and hammerjs excluded. The generated bundle can be minified with uglifyjs: diff --git a/gulpfile.js b/gulpfile.js index 460d8346..f6cb0a80 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -45,14 +45,16 @@ var webpackConfig = { }, module: { loaders: [ - { test: /\.js$/, exclude: /node_modules/, loader: '6to5-loader'} + { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'} ], // exclude requires of moment.js language files wrappedContextRegExp: /$^/ }, plugins: [ bannerPlugin ], - cache: true + cache: true, + debug: true, + bail: true }; var uglifyConfig = { @@ -75,7 +77,7 @@ gulp.task('bundle-js', ['clean'], function (cb) { bannerPlugin.banner = createBanner(); compiler.run(function (err, stats) { - if (err) gutil.log(err); + if (err) gutil.log(err.toString()); cb(); }); }); diff --git a/lib/network/modules/components/edges/BezierEdgeDynamic.js b/lib/network/modules/components/edges/BezierEdgeDynamic.js index 79473566..b4d4de48 100644 --- a/lib/network/modules/components/edges/BezierEdgeDynamic.js +++ b/lib/network/modules/components/edges/BezierEdgeDynamic.js @@ -2,7 +2,7 @@ import BezierEdgeBase from './util/BezierEdgeBase' class BezierEdgeDynamic extends BezierEdgeBase { constructor(options, body, labelModule) { - this.via = undefined; + //this.via = undefined; // Here for completeness but not allowed to defined before super() is invoked. super(options, body, labelModule); // --> this calls the setOptions below } diff --git a/lib/timeline/component/graph2d_types/points.js b/lib/timeline/component/graph2d_types/points.js index 582bad6f..235026b5 100644 --- a/lib/timeline/component/graph2d_types/points.js +++ b/lib/timeline/component/graph2d_types/points.js @@ -18,7 +18,7 @@ Points.prototype.getYRange = function(groupData) { Points.prototype.draw = function(dataset, group, framework, offset) { Points.draw(dataset, group, framework, offset); -} +}; /** * draw the data points diff --git a/package.json b/package.json index f84210b1..465e623f 100644 --- a/package.json +++ b/package.json @@ -35,9 +35,9 @@ "propagating-hammerjs": "^1.3.0" }, "devDependencies": { - "6to5": "^3.5.3", - "6to5-loader": "^3.0.0", - "6to5ify": "^4.1.0", + "babel": "^5.1.8", + "babel-loader": "^5.0.0", + "babelify": "^6.0.2", "clean-css": "latest", "gulp": "^3.8.11", "gulp-concat": "^2.4.3", @@ -48,7 +48,7 @@ "mocha": "^2.1.0", "rimraf": "^2.2.8", "uglify-js": "^2.4.16", - "webpack": "^1.5.3", + "webpack": "^1.8.4", "yargs": "^2.3.0" } }