A
A
Arsen Abakarov2017-04-27 19:02:06
Django
Arsen Abakarov, 2017-04-27 19:02:06

Django, static minification with gulp?

There is a project on django
Now all the statics are scattered around django apps, there are a lot of templates, some js are connected in some others, some js is generally sewn into templates, all this is for some kind of initialization ..., most of the statics are still connected in the base template
There are plugins like bootstrap, jquery...
All statics are collected by collectstatic, as a result we have a bunch of files, with all the consequences.. like the number of requests to the server..
My colleague and I decided to implement gulp for smart assembly.
I would like to have one min.js and one min.css output, including all
gulpfile libraries in them, everything is assembled, but a number of rakes arose:
1) Relative paths to resources, such as fonts, pictures, etc., are hardcoded in the libraries. (sort of solved with gulp-replace)
2) Libraries should be in the code before everything else (everything was done by merging the necessary threads in the right order)
3) Part of our js stupidly does not work, since some sections are simply not initialized (here it’s still unclear what to do ...)
How can it all be resolved, especially point 3, is it really possible to create some kind of script - an initializer ..?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2017-04-27
@ArsenAbakarov

1. It should be solved inside less/sass
2. We make one (two) root of the heatplate, from which all the rest are inherited - we put things in order there
3. This happens when refactoring - we throw out the shit code and write in a human way

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question