Browse Source

replaced `6to5` with `babel`, letting webpack output errors, minor fix

flowchartTest
jos 9 years ago
parent
commit
e881a78462
5 changed files with 13 additions and 11 deletions
  1. +2
    -2
      README.md
  2. +5
    -3
      gulpfile.js
  3. +1
    -1
      lib/network/modules/components/edges/BezierEdgeDynamic.js
  4. +1
    -1
      lib/timeline/component/graph2d_types/points.js
  5. +4
    -4
      package.json

+ 2
- 2
README.md View File

@ -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:

+ 5
- 3
gulpfile.js View File

@ -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();
});
});

+ 1
- 1
lib/network/modules/components/edges/BezierEdgeDynamic.js View File

@ -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
}

+ 1
- 1
lib/timeline/component/graph2d_types/points.js View File

@ -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

+ 4
- 4
package.json View File

@ -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"
}
}

Loading…
Cancel
Save