You need to run a couple of npm commands in the project root.
npm installInstalls jsPlumb's dependencies
Builds (and renames, to remove the version suffix, so we dont have to keep updating this page) the bundle that would be published to npm via the npm publish command. In this demo we use a local require in our package json:
"devDependencies": {
"grunt-webpack": "^1.0.11",
"jsplumb": "file:../../jsplumb.tgz",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1"
}
but we'd expect you to require jsPlumb from the npm repo:
"devDependencies": {
"grunt-webpack": "^1.0.11",
"jsplumb": "X.X.X",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1"
}
npm run init
Runs npm install in this demo's directory.
To get webpack and jsPlumb.
Runs grunt build in this demo's directory
Which runs webpack and generates a bundle.js file in the dist directory of this demo
The webpack config is in the file webpack.config.js
var path = require("path");
var webpack = require("webpack");
module.exports = {
cache: true,
entry: {
bundle: "./index.js"
},
output: {
path: path.join(__dirname, "dist"),
publicPath: "dist/",
filename: "[name].js",
chunkFilename: "[chunkhash].js"
}
};