miracle2k / django-assets

Django webassets integration.
BSD 2-Clause "Simplified" License
89 stars 79 forks source link

Automatic rebuild on `./manage.py runserver` #88

Open sils opened 7 years ago

sils commented 7 years ago

Is it possible to have the automatic rebuild of the assets running on ./manage.py runserver?

See also http://webassets.readthedocs.io/en/latest/script.html#watch , CC @userzimmermann

miracle2k commented 7 years ago

Something like this could possible be created, but it doesn't exist yet. We wouldn't be the first ones to want to overwrite the "runserver" command, so I think it's possible, though potentially also confusing, if other extensions try to do the same thing.

userzimmermann commented 7 years ago

@miracle2k Couldn't this be also achived by some Middleware that does the rebuilding on every request automatically when in DEBUG = True mode? It's just a sontaneous thought... I'm not that familiar with the middleware stuff...

CC @sils

miracle2k commented 7 years ago

We have that already. It's called ASSETS_AUTO_BUILD. The "watch" command improves on that by not waiting until the request comes in; the idea is that this would reduce the wait time on page refresh.

userzimmermann commented 7 years ago

@miracle2k And what about a websocket? Which is opened by a special assets URL. Then handles the watch in the backend. And additionally informs the user about the rebuild actions in the frontend...

miracle2k commented 7 years ago

It's possible to build something like this. It doesn't exist at this time.