working vite widget setup for prod (untested), local dev (with or without dev server) and pytests, with flags for running the old version or the vite version

This commit is contained in:
rash
2026-02-22 17:40:25 +01:00
parent 3f92868dba
commit b1b2a688a8
8 changed files with 139 additions and 49 deletions

View File

@@ -28,6 +28,7 @@ from setuptools.command.build import build
from setuptools.command.build_ext import build_ext
here = os.path.abspath(os.path.dirname(__file__))
project_root = os.path.abspath(os.path.join(here, '..', '..'))
npm_installed = False
@@ -43,6 +44,10 @@ def npm_install():
npm_installed = True
def npm_build():
subprocess.check_call('npm run build', shell=True, cwd=project_root)
class CustomBuild(build):
def run(self):
if "src" not in os.listdir(".") or "pretix" not in os.listdir("src"):
@@ -62,6 +67,7 @@ class CustomBuild(build):
settings.COMPRESS_OFFLINE = True
npm_install()
npm_build()
management.call_command('compilemessages', verbosity=1)
management.call_command('compilejsi18n', verbosity=1)
management.call_command('collectstatic', verbosity=1, interactive=False)