From 4e690bf5fca9a8b8e5de2cd2b873b16a65ca2ef4 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 16 Mar 2022 22:21:16 +0000 Subject: [PATCH] Fix a couple of issues with Webpack + Docker --- {{cookiecutter.project_slug}}/local.yml | 2 ++ {{cookiecutter.project_slug}}/webpack/dev.config.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index 1c0e4ae78..3ffd63298 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -124,7 +124,9 @@ services: command: npm run dev ports: - "3000:3000" + {%- if cookiecutter.frontend_pipeline == 'Gulp' %} # Expose browsersync UI: https://www.browsersync.io/docs/options/#option-ui - "3001:3001" + {%- endif %} {%- endif %} diff --git a/{{cookiecutter.project_slug}}/webpack/dev.config.js b/{{cookiecutter.project_slug}}/webpack/dev.config.js index e2a36a412..43b991d7c 100644 --- a/{{cookiecutter.project_slug}}/webpack/dev.config.js +++ b/{{cookiecutter.project_slug}}/webpack/dev.config.js @@ -7,7 +7,11 @@ module.exports = merge(commonConfig, { devServer: { port: 3000, proxy: { + {%- if cookiecutter.use_docker == 'n' %} '/': 'http://0.0.0.0:8000', + {%- else %} + '/': 'http://django:8000', + {%- endif %} }, // We need hot=false (Disable HMR) to set liveReload=true hot: false,