문제

I use RequireJS for managing dependencies between my JavaScript libraries and modules. The backend is written in Django. Django has many apps for managing static assets, but none of them talk about incorporating the r.js compiler.

What's the best way to manage and compile my JS files using r.js in Django?

My requirements are:

  1. Versioned output file to get around caching when the file is updated.
  2. Automatically use uncompiled JS file when DEBUG = True in settings.py for Django, and the compiled file when Debug = False.
  3. Some of the libraries will be loaded from CDN (such jquery) with a local fallback.

Any suggestions will be much appreciated.

도움이 되었습니까?

해결책

Seems as though django-require covers at least some of what you need, https://github.com/etianen/django-require .

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top