From: test test Date: Thu, 15 Jul 2021 15:31:28 +0000 (+0200) Subject: Better handling interoperability between webpack dev server and docker X-Git-Tag: 2.4.4~16 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=edaaee23737e1c420d33761ab461cb2ccc53281a;p=teleforma.git Better handling interoperability between webpack dev server and docker --- diff --git a/teleforma/templatetags/webpack.py b/teleforma/templatetags/webpack.py index b3e947a0..d5f8cdfe 100644 --- a/teleforma/templatetags/webpack.py +++ b/teleforma/templatetags/webpack.py @@ -20,13 +20,15 @@ def webpack(bundle): WEBPACK_APP_URL = '{}{}'.format(settings.WEBPACK_DEV_SERVER_URL, bundle) request = requests.get(WEBPACK_APP_URL) if request.status_code == 200: - url = WEBPACK_APP_URL + # host.docker.internal is only available in the context of the container, not in the browser + url = WEBPACK_APP_URL.replace('host.docker.internal', 'localhost') if is_css: url = None except requests.ConnectionError: pass - url += '?v=' + teleforma.__version__ + if url: + url += '?v=' + teleforma.__version__ return { 'is_css': is_css,