diff --git a/aleksis/core/management/__init__.py b/aleksis/core/management/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/aleksis/core/management/commands/write_webpack_entrypoints.py b/aleksis/core/management/commands/write_webpack_entrypoints.py new file mode 100644 index 0000000000000000000000000000000000000000..80b18548bc40f6f115ffb9d698b58c02ae08a534 --- /dev/null +++ b/aleksis/core/management/commands/write_webpack_entrypoints.py @@ -0,0 +1,21 @@ +import json +import os + +from django.conf import settings +from django.core.management.base import BaseCommand, CommandError + +from ...util.frontend_helpers import get_apps_with_assets + + +class Command(BaseCommand): + help = "Write out webpack entrypoints for all apps" + + def handle(self, *args, **options): + assets = { + app: {"dependOn": "core", "import": os.path.join(path, "index")} + for app, path in get_apps_with_assets().items() + } + assets["core"] = os.path.join(settings.BASE_DIR, "aleksis", "core", "assets", "index") + + with open(os.path.join(settings.BASE_DIR, "webpack-entrypoints.json"), "w") as out: + json.dump(assets, out)