rykener / django-manifest-loader

Simplifies webpack configuration with Django
https://django-manifest-loader.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
104 stars 12 forks source link

WEBPACK_SETTINGS wants webpack's output directory, it should be able to infer it #6

Closed rykener closed 3 years ago

rykener commented 3 years ago
# settings.py

STATICFILES_DIRS = [
    BASE_DIR / 'dist'
]

WEBPACK_SETTINGS = {
    'output_dir': BASE_DIR / 'dist'
}

It was originally setup this way to not assume which directory within STATICFILES_DIRS the manifest file is in. However we can perform some basic logic to find it. if len(STATICFILES_DIRS) == 1 then we know it'll be in STATICFILES_DIRS[0]. If it's longer than 1 then we can just iterate through and check.

Should still allow the user to set the output dir in order to not have to do all that checking.

rykener commented 3 years ago

fixed