I was fortunate enough to open django_compressor and implement it in our stack, which is deployed on many servers (currently 6, but when we deploy small virtual machines.)
Now everything is fine and dandy if you use django_compressor at its best. CSS / JS Source Compression
However, tell me, now I want to introduce some type of pre-compiler. Let them say that for this example it is LESS (css). The thought process for this is quite simple:
Now you are deploying and your server is compiling fewer files. Everything is fantastic!
Now add 8 more servers and you have to install node, npm and less on each server?
That something seems wrong, and I feel that something is missing. I believe the Django community has encountered this problem before.
My thoughts so far have been:
Use post-commit to compile CSS on a development machine. This means that through django_compressor we refer to the compiled static file in HTML, and our repository contains both compiled and non-compiled versions. My only downside is that it does not take half the advantages of django_compressor and can be tedious for developers?
Connect it and create node, npm and less of the server stack.
Update
I did some additional inspections, and it seems that using the COMPRESS_OFFLINE flag (or just --force) with the control command will lead to the creation of a stand-alone manifest file that does what I need (tested only locally). So setting this up with a pre-deployed hook likes to be the answer.
Of course, still open to other ideas :-)
source share