From db33c3f923271ffe3a4227fc0d13114dadd488a9 Mon Sep 17 00:00:00 2001 From: Charlotte Weaver Date: Tue, 27 Feb 2018 16:55:00 -0800 Subject: [PATCH] Add build for deployment using jinja2 templating for url base --- configuration/webpack/webpack.config.prod.js | 3 ++- index_template.html | 28 ++++++++++++++++++++ package.json | 1 + src/globals.js | 4 ++- 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 index_template.html diff --git a/configuration/webpack/webpack.config.prod.js b/configuration/webpack/webpack.config.prod.js index 3dc27a02..666ecdfa 100644 --- a/configuration/webpack/webpack.config.prod.js +++ b/configuration/webpack/webpack.config.prod.js @@ -64,7 +64,8 @@ module.exports = { plugins: [ new HtmlWebpackPlugin({ inject: 'body', - template: path.resolve('index.html'), + filename: 'index.html', + template: path.resolve('index_template.html'), favicon: path.resolve('favicon.png'), inlineSource: '.(js|css)$', minify: { diff --git a/index_template.html b/index_template.html new file mode 100644 index 00000000..e168a66c --- /dev/null +++ b/index_template.html @@ -0,0 +1,28 @@ + + + + + + Cellx + + + + + + +
+ + + + \ No newline at end of file diff --git a/package.json b/package.json index 25f35e8f..2f5263af 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "repository": "https://github.com/chanzuckerberg/cellxgene", "scripts": { "build": "npm run clean && webpack --config configuration/webpack/webpack.config.prod.js", + "dev": "npm run clean && webpack --config configuration/webpack/webpack.config.dev.js", "clean": "rimraf build", "start": "node server/development.js", "lint": "eslint src", diff --git a/src/globals.js b/src/globals.js index d3481882..74de0300 100644 --- a/src/globals.js +++ b/src/globals.js @@ -35,12 +35,14 @@ export const tiniestFontSize = 12; export const bolder = 700; -export const API = { +export let API = { // prefix: "http://api.clustering.czi.technology/api/", prefix: "http://api-staging.clustering.czi.technology/api/", version: "v0.1/", } +if (window.CELLXGENE && window.CELLXGENE.API) API = window.CELLXGENE.API; + export const accentFont = "Georgia,Times,Times New Roman,serif"; export const maxParagraphWidth = 600; export const maxControlsWidth = 800;