Skip to content
Snippets Groups Projects
Verified Commit 17b73af6 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Run Vite dev server together with DEBUG runuwsgi

parent d81dfc30
No related branches found
No related tags found
1 merge request!1132Resolve "Evaluate use of Vite instead of Webpack"
...@@ -11,6 +11,10 @@ from ...util.frontend_helpers import run_vite, write_vite_values ...@@ -11,6 +11,10 @@ from ...util.frontend_helpers import run_vite, write_vite_values
class Command(BaseYarnCommand): class Command(BaseYarnCommand):
help = "Create Vite bundles for AlekSIS" # noqa help = "Create Vite bundles for AlekSIS" # noqa
def add_arguments(self, parser):
parser.add_argument("command", choices=["build", "serve"], default="build")
parser.add_argument("--no-install", action="store_true", default=False)
def handle(self, *args, **options): def handle(self, *args, **options):
super(Command, self).handle(*args, **options) super(Command, self).handle(*args, **options)
...@@ -18,7 +22,8 @@ class Command(BaseYarnCommand): ...@@ -18,7 +22,8 @@ class Command(BaseYarnCommand):
write_vite_values(os.path.join(settings.NODE_MODULES_ROOT, "django-vite-values.json")) write_vite_values(os.path.join(settings.NODE_MODULES_ROOT, "django-vite-values.json"))
# Install Node dependencies # Install Node dependencies
yarn_adapter.install(settings.YARN_INSTALLED_APPS) if not options["no_install"]:
yarn_adapter.install(settings.YARN_INSTALLED_APPS)
# Run Vite build # Run Vite build
run_vite(["build"]) run_vite([options["command"]])
...@@ -744,6 +744,7 @@ if _settings.get("dev.uwsgi.celery", DEBUG): ...@@ -744,6 +744,7 @@ if _settings.get("dev.uwsgi.celery", DEBUG):
UWSGI.setdefault("attach-daemon", []) UWSGI.setdefault("attach-daemon", [])
UWSGI["attach-daemon"].append(f"celery -A aleksis.core worker --concurrency={concurrency}") UWSGI["attach-daemon"].append(f"celery -A aleksis.core worker --concurrency={concurrency}")
UWSGI["attach-daemon"].append("celery -A aleksis.core beat") UWSGI["attach-daemon"].append("celery -A aleksis.core beat")
UWSGI["attach-daemon"].append("aleksis-admin vite --no-install serve")
DEFAULT_FAVICON_PATHS = { DEFAULT_FAVICON_PATHS = {
"pwa_icon": os.path.join(STATIC_ROOT, "img/aleksis-icon-maskable.png"), "pwa_icon": os.path.join(STATIC_ROOT, "img/aleksis-icon-maskable.png"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment