Skip to content

Commit

Permalink
default dev_server_port=5173 for non-legacy users
Browse files Browse the repository at this point in the history
  • Loading branch information
Niicck committed Oct 19, 2023
1 parent 9967dbf commit ca2224a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions django_vite/core/asset_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DjangoViteConfig(NamedTuple):
dev_server_host: str = "localhost"

# Default Vite server port.
dev_server_port: int = 3000
dev_server_port: int = 5173

# Prefix for STATIC_URL.
static_url_prefix: str = ""
Expand Down Expand Up @@ -720,12 +720,15 @@ def _apply_legacy_django_vite_settings(cls):
DeprecationWarning,
)

legacy_config = {}
# Keep same default dev_server_port for legacy users that are still on vite v2.
legacy_config = {
"dev_server_port": 3000,
}

for legacy_setting in applied_legacy_settings:
new_config_name = cls.LEGACY_DJANGO_VITE_SETTINGS[legacy_setting]
if new_config_name:
legacy_config[new_config_name] = getattr(settings, legacy_setting)

legacy_config = DjangoViteConfig(**legacy_config)
cls._instance._apps[DEFAULT_APP_NAME] = DjangoViteAppClient(legacy_config)

Expand Down

0 comments on commit ca2224a

Please sign in to comment.