Skip to content

Commit

Permalink
Add .vite directory in manifest.json path
Browse files Browse the repository at this point in the history
  • Loading branch information
leogallot committed Dec 12, 2023
1 parent 66fce41 commit 8e2e2f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export default defineConfig({

### manifest_path
- **Type**: `str | Path`
- **Default**: `Path(settings.STATIC_ROOT) / static_url_prefix / "manifest.json"`
- **Default**: `Path(settings.STATIC_ROOT) / static_url_prefix / ".vite" / "manifest.json"`
- **Legacy Key**: `DJANGO_VITE_MANIFEST_PATH`

The absolute path, including the filename, to the ViteJS manifest file located in `build.outDir`.
Expand Down
3 changes: 2 additions & 1 deletion django_vite/core/asset_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _clean_manifest_path(self) -> Path:
"""
Get the manifest_path from the config.
If it wasn't provided, set the default location to
STATIC_ROOT / static_url_prefix / "manifest.json".
STATIC_ROOT / static_url_prefix / ".vite" / "manifest.json".
Returns:
Path -- the path to the vite config's manifest.json
Expand All @@ -110,6 +110,7 @@ def _clean_manifest_path(self) -> Path:
return (
Path(settings.STATIC_ROOT)
/ self._config.static_url_prefix
/ ".vite"
/ "manifest.json"
)
elif not isinstance(initial_manifest_path, Path):
Expand Down

0 comments on commit 8e2e2f5

Please sign in to comment.