From 4080e9a86df8c0ba080cc7fe3b54df0f7a4e74f0 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 6 Feb 2023 16:16:48 +0000 Subject: [PATCH] Fix django-webpack-loader setup when running tests (#4128) * Add an integration test This should cover the problem raised for webpack loader issues * Add a DummyWebpackLoader for running tests * Replace DummyWebpackLoader by the one from webpack_loader package * Fix post-gen hook * Remove integration test --- {{cookiecutter.project_slug}}/config/settings/test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index 198b5aa5..587b9932 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -29,5 +29,13 @@ EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend" # ------------------------------------------------------------------------------ TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore # noqa F405 +{%- if cookiecutter.frontend_pipeline == 'Webpack' %} +# django-webpack-loader +# ------------------------------------------------------------------------------ +WEBPACK_LOADER["DEFAULT"][ # noqa F405 + "LOADER_CLASS" +] = "webpack_loader.loader.FakeWebpackLoader" + +{%- endif %} # Your stuff... # ------------------------------------------------------------------------------