Closed graingert closed 8 years ago
bower resolutions is missing for that purpose:
I think it is worth noting on this issue that while django-bower doesn't have explicit support for bower resolutions, the copy of bower that it spawns will respect an existing bower.json if there is one. While not ideal this can provide a usable workaround.
You can use 'manage.py bower init' to interactively create a bower.json file in the BOWER_COMPONENTS_ROOT folder. Answer 'No' to the question 'set currently installed components as dependencies' as these will be listed in Django settings.
Once you have created the bower.json file the '! to persist to bower.json' will update the requirements section of that file.
Hi,
Here I dynamically add the requirements in my module's app.py, so that each module defines it's own js dependencies :
class MyAppConfig(AppConfig):
name = 'ToolMap'
def ready(self):
settings.BOWER_INSTALLED_APPS.extend([
'ol3=https://github.com/openlayers/ol3/releases/download/v3.16.0/v3.16.0-dist.zip',
'js-cookie#2.1.0',
"fontawesome#~4.5.0",
])
I think it's much cleaner than defining everything in a central file. But this also means I can't use the bower.json file in BOWER_COMPONENTS_ROOT.
I'd love a BOWER_RESOLUTIONS setting or something like that allowing for non-interactive update of bower dependencies in my case.
Thanks for the great work !
In some situations I've needed to downgrade/upgrade versions of bower components but django_bower fails with some dependency issues:
It would be nice to always respect the values in BOWER_INSTALLED_APPS.
As a work-around I've been deleting the bower components directory.