mistercrunch commented on a change in pull request #3262: [webpack] break CSS 
and JS files while webpackin'
URL: 
https://github.com/apache/incubator-superset/pull/3262#discussion_r132235404
 
 

 ##########
 File path: superset/__init__.py
 ##########
 @@ -32,19 +32,21 @@
 app.config.from_object(CONFIG_MODULE)
 conf = app.config
 
+# Handling manifest file logic at app start
+MANIFEST_FILE = APP_DIR + '/static/assets/dist/manifest.json'
+get_manifest_file = lambda x: x
+manifest = {}
+try:
+    with open(MANIFEST_FILE, 'r') as f:
+        manifest = json.load(f)
+    get_manifest_file = lambda x: '/static/assets/dist/' + manifest.get(x, '')
+except Exception:
+    print("no manifest file found at " + MANIFEST_FILE)
+
 
 @app.context_processor
 def get_js_manifest():
-    manifest = {}
-    try:
-        with open(APP_DIR + '/static/assets/dist/manifest.json', 'r') as f:
 
 Review comment:
   This happened at every request :(
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to