Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dependencies based voyager build change #32

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
</body>

<script>
require('./renderer.js')
require('./dist/app.js')
</script>
</html>
24 changes: 21 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "A minimal Electron application that embeds voyager",
"main": "main.js",
"scripts": {
"build": "webpack --config=webpack.config.js",
"start": "electron .",
"start:server": "electron . --server",
"dist": "electron-builder",
Expand Down Expand Up @@ -32,13 +33,30 @@
"datavoyager": "^2.0.0-alpha.12",
"datavoyager-server": "git://github.com/vega/voyager-server.git",
"electron-debug": "^1.1.0",
"jschardet": "^1.4.2"
"jschardet": "^1.4.2",
"react-tether": "0.5.6",
"redux-undo": "1.0.0-beta9-9-6",
"vega": "3.0.2",
"vega-datasets": "^1.10.0",
"vega-lite": "^2.0.0-beta.16",
"vega-tooltip": "^0.4.3",
"react-css-modules": "4.1.0",
"whatwg-fetch": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-1.0.0.tgz",
"font-awesome-sass-loader": "1.0.3",
"font-awesome": "4.6.3",
"electron": "~1.6.10"
},
"devDependencies": {
"electron": "~1.6.10",
"style-loader": "0.13.1",
"sass-loader": "4.1.1",
"css-loader": "^0.23.1",
"electron-builder": "^19.16.2",
"eslint": "^3.19.0",
"eslint-config-airbnb-base": "^11.2.0",
"eslint-plugin-import": "^2.3.0"
"eslint-plugin-import": "^2.3.0",
"file-loader": "^0.11.2",
"node-sass": "^4.5.3",
"url-loader": "^0.5.9",
"webpack": "^3.5.5"
}
}
1 change: 1 addition & 0 deletions renderer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require('font-awesome-sass-loader');
const libVoyager = require('datavoyager');
const { ipcRenderer, remote } = require('electron');

Expand Down
36 changes: 36 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const path = require('path');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajainarayanan I though you say the normal lib build works fine -- do we really still need this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required for font-awesome-sass-loader Since we marked font-awesome-* as external in voyager we need to add this. This is to parse font awesome font files and serve them using url-loader.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the webpack build step to generate a library build explicitly for electron environment in the voyager PR. This however is required for using font-awesome loader in voyager.


module.exports = {
entry: {
app: './renderer.js',
},
output: {
filename: './[name].js',
path: path.join(__dirname, '/dist'),
},
target: 'electron-renderer',
module: {
rules: [
{
test: /\.scss$/,
loader: 'style-loader!css-loader!postcss-loader!sass-loader',
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: [
{
loader: 'url-loader',
options: {
limit: 10000,
mimetype: 'application/font-woff',
},
},
],
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: 'url-loader',
},
],
},
};