Import vis.js using webpack

I would like to import only from DataSetand into our Webpack application using ES6 modules.Networkvis.js

One easy way to do this is to simply import it dist/vis-network.min.js, but it is already minified, so it’s not very compatible with our webpack workflow.

I looked through the vis.js code and did not use ES6 modules, so I can not importthem.

Is there an easier way to do custom vis.js build ?

+4
source share
2 answers

, vis.js, . vis.js, .

, , , vis.js webpack.

0

vis.js.

:

gulpfile.js INDIVIDUAL_BUNDLES.

:

var INDIVIDUAL_BUNDLES = [
 {entry: './index-timeline-graph2d.js', filename: 'vis-timeline-
    graph2d.min.js'},
 {entry: './index-network.js', filename: 'vis-network.min.js'},
 {entry: './index-graph3d.js', filename: 'vis-graph3d.min.js'},
 {entry: './index-graph3d.js', filename: 'vis-graph3d.js', 'notMini': 
  true}
];

​​ vis-graph3d, .

--, , config :

 {entry: './index-network.js', filename: 'vis-network.js', 'notMini': true},

.

(. README.md) :

$ cd vis
$ npm install
$ npm run build

dist vis-network.js.

0

Source: https://habr.com/ru/post/1662829/


All Articles