Django Compressor & JS tooling (Gulp, Webpack...) #1095
-
There are number of tools that are used a lot among purely Javascript developers, but they tend to change every few years. We had Bower, Grunt & Gulp, now Webpack, parcel and rollup are quite popular, tomorrow esbuild and the likes will rule that space. I'm wondering how django-compressor positions itself in this landcape of front-end tools: is it an alternative to them or something that can be used alongside them? Is there any point in trying to configure e.g. Gulp to build & optimise my SASS/JS files and then wrap its output inside a pair of Context: Cookiecutter Django currently offers the option to have Gulp as JS task runner (to compiles SASS to CSS and minifies the JS) with django compressor on top, but it feels like 2 competing solutions. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I don't think there is much point of using both. IMHO these days compressor is mostly useful as an alternative for people who don't want to keep up with the ever changing JavaScript-based frontend assets pipeline landscape and have an easy to set up tool that works both in development and in production built for Django projects. FWIW I consider compressor pretty much done in terms of features at this point. People that want more features, something more modern, or better integrated with a JavaScript stack should look elsewhere. |
Beta Was this translation helpful? Give feedback.
-
Hey @browniebroke. I've used compressor with all number of these tools over the years. I essentially defer to the tool-in-play by defining You don't need compressor for this but (for me) it answers the How does this tie-in to Django? question very well: Just add a link or script tag in the appropriate place and you're done. (The fact that it understands There may be a few other niceties, like reloads, and cache clearing, and things that could be smoothed — in collaboration with other Django ecosystem packages — but TBH I don't see those being handled better with other tooling. |
Beta Was this translation helpful? Give feedback.
I don't think there is much point of using both. IMHO these days compressor is mostly useful as an alternative for people who don't want to keep up with the ever changing JavaScript-based frontend assets pipeline landscape and have an easy to set up tool that works both in development and in production built for Django projects.
FWIW I consider compressor pretty much done in terms of features at this point. People that want more features, something more modern, or better integrated with a JavaScript stack should look elsewhere.