File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
- {% set development = True %}
2
1
<!DOCTYPE html>
3
2
< html lang ="de ">
4
3
< head >
7
6
{%- block additionalhead %}
8
7
9
8
{% endblock %}
10
- {{inject_vite(development )}}
9
+ {{inject_vite()}}
11
10
</ head >
12
11
< body >
13
12
< div id ="vite_context ">
Original file line number Diff line number Diff line change @@ -17,12 +17,19 @@ def _postProcessAppObj(obj):
17
17
18
18
import typing as t
19
19
import json as _json
20
- import logging
20
+ import logging , requests
21
21
from viur .core .render .html .utils import jinjaGlobalFunction
22
22
@jinjaGlobalFunction
23
- def inject_vite (render , development : bool = False ) -> t .Any :
23
+ def inject_vite (render , development : bool | None = None ) -> t .Any :
24
24
"""build vue imports from manifest"""
25
25
26
+ if development is None :
27
+ try :
28
+ resp = requests .get ("http://localhost:8081" )
29
+ development = resp .status_code == 200
30
+ except Exception as e :
31
+ development = False
32
+
26
33
if development :
27
34
return """<script type="module" src="http://localhost:8081/@vite/client"></script>
28
35
<script type="module" src="http://localhost:8081/main.js"></script>"""
You can’t perform that action at this time.
0 commit comments