diff --git a/.gitignore b/.gitignore
index c5a4a7aa..9c2e4450 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,9 +24,14 @@ server/common/web/static/img/
server/common/web/static/media/
server/common/web/static/fonts/
server/common/web/static/js/
-server/common/web/templates/index\.html
+server/common/web/templates/
server/common/web/csp-hashes.json
+# eb build
+artifact.dir
+artifact.zip
+customize
+
# Jupyter Notebook
.ipynb_checkpoints
*.ipynb
diff --git a/client/Makefile b/client/Makefile
index 256048f4..ff8eb1b5 100644
--- a/client/Makefile
+++ b/client/Makefile
@@ -1,8 +1,4 @@
include ../common.mk
-# https://stackoverflow.com/a/14777895/9587410
-ifeq ($(shell uname),Darwin) # is Windows_NT on XP, 2000, 7, Vista, 10...
- IS_DARWIN := "true"
-endif
ANNOTATIONS := $(if $(ANNOTATIONS),$(ANNOTATIONS),../server/test/test_datasets/pbmc3k-annotations.csv)
ANNOTATIONS_FILENAME := $(shell basename $(ANNOTATIONS))
@@ -21,8 +17,9 @@ install:
npm install
.PHONY: build
+WEBPACK_CONFIG ?= configuration/webpack/webpack.config.prod.js
build:
- npm run build
+ npm run build $(WEBPACK_CONFIG)
# Formatting code
diff --git a/client/configuration/webpack/cspHashPlugin.js b/client/configuration/webpack/cspHashPlugin.js
index fa532ef6..d56d2b32 100644
--- a/client/configuration/webpack/cspHashPlugin.js
+++ b/client/configuration/webpack/cspHashPlugin.js
@@ -32,17 +32,15 @@ class CspHashPlugin {
};
}
- // remove no-csp-hash attributes
- let foundOne = false;
- $("script[no-csp-hash]").each((i, elmt) => {
- $(elmt).removeAttr("no-csp-hash");
- foundOne = true;
- });
- $("style[no-csp-hash]").each((i, elmt) => {
- $(elmt).removeAttr("no-csp-hash");
- foundOne = true;
- });
- if (foundOne) data.html = $.html();
+ // Remove no-csp-hash attributes. Cheerio does not parse Jinja templates
+ // correctly, so we brute force this with a regular expression.
+ data.html = data.html
+ .replace(/(
- {% endfor %}
+ {% for script in SCRIPTS -%}
+
+ {%- endfor %}
{% for ils in INLINE_SCRIPTS %}
-
{% endfor %}