Skip to content

Commit

Permalink
Merge pull request #393 from jpmorganchase/webpack-example
Browse files Browse the repository at this point in the history
Update Webpack example to webpack 4
  • Loading branch information
texodus authored Jan 23, 2019
2 parents e01856f + 7afc019 commit 2a59ea7
Show file tree
Hide file tree
Showing 5 changed files with 1,533 additions and 59 deletions.
10 changes: 7 additions & 3 deletions examples/webpack/in.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
*/

const perspective = require("@jpmorganchase/perspective").default;
require("@jpmorganchase/perspective-viewer");

const table = perspective.worker().table([{x: 1}]);
table.view().to_json(console.log);
(async () => {
const worker = perspective.worker();
const table = worker.table([{x: 1, y: 2}, {x: 2, y: 2}]);
const view = await table.view();
const json = await view.to_json();
console.log(json);
})();
11 changes: 9 additions & 2 deletions examples/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@
"version": "0.2.12",
"description": "An example of using the Perspective Webpack plugin to build a JS file with Webpack.",
"scripts": {
"start": "node server.js",
"start": "webpack-dev-server --content-base ./ --hot",
"webpack": "webpack --config webpack.config.js --color"
},
"keywords": [],
"license": "Apache-2.0",
"dependencies": {
"@jpmorganchase/perspective": "^0.2.12",
"@jpmorganchase/perspective-viewer": "^0.2.12"
"@jpmorganchase/perspective-viewer": "^0.2.12",
"@jpmorganchase/perspective-viewer-highcharts": "^0.2.12",
"@jpmorganchase/perspective-viewer-hypergrid": "^0.2.12"
},
"devDependencies": {
"webpack": "^4.28.4",
"webpack-cli": "3.2.1",
"webpack-dev-server": "^3.1.14"
}
}
2 changes: 2 additions & 0 deletions examples/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const PerspectivePlugin = require("@jpmorganchase/perspective/webpack-plugin");
const path = require("path");

module.exports = {
context: __dirname,
mode: "development",
entry: "./in.js",
output: {
filename: "out.js",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
],
"devDependencies": {
"@apache-arrow/es5-esm": "^0.3.1",
"babel-core": "^7.0.0-0",
"babel-eslint": "^8.2.3",
"babel-jest": "^23.6.0",
"chart.js": "^2.7.1",
Expand Down
Loading

0 comments on commit 2a59ea7

Please sign in to comment.