A
A
Alexander2017-05-27 12:02:57
css
Alexander, 2017-05-27 12:02:57

How do you compress css/js and take it into account in git?

A WordPress theme is being developed , which is already being used in production. The css files are edited during the development of the feature, then, as a result, the css is compressed using online services, the minimized code is inserted into header.php , and the connection of style files is removed from there. And when the next feature needs to be developed, the style files are connected again and everything is new.
The current terrible approach does not suit. Moreover, git is also used. Somehow, ideally, if the css would be compressed themselves, or if there were ordinary css in the developer branch , and in the master branch - there is already compressed in header.php instead of .css connections ...
How to do it right?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anatoly Medvedev, 2017-05-27
@balamyt92

The resulting css and js bundles should not be in the git from the word at all. You can compress anything, take your favorite bundler / taxi runner and plugins for it to your liking. In your case, gulp is enough. There are a lot of articles about how to deal with this matter.

A
Alexey Sklyarov, 2017-05-27
@0example

I think for this it's enough just to use a .sass style file, which, when saved, will automatically be compressed into a style.min.css file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question