W
W
westwood2014-12-09 10:34:52
git
westwood, 2014-12-09 10:34:52

Phpstorm watcher less+git?

Have you encountered the problem that when you switch between branches, phpstorm recompiles less and therefore you either have to reset the styles recompiled in the new branch or turn off the watcher when switching between branches? what other solutions exist?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
westvud, 2014-12-09
@westwood

Found out what's wrong. Our problem was that the developers have different versions of the
LESS compiler (lessc). When switching between branches in VCS, less files with
the results of their compilation were checked out (this is how it works for us). If any less file was pushed by
another developer, then the compilation result in the commit differs from what the
local lessc gives. So lessc recompiles it and hence the changed files
in the working copy (compiled from .less .css files) arise.

V
Vanger, 2014-12-09
@Vanger

For example, abandon the watcher in Phpstorm in the direction of Gulp or Grunt. Moreover, PHPStorm supports Grunt from the box.

less: {
            development: {
                options: {
                    compress: true  //minifying the result
                },
                files: {
                    //compiling frontend.less into frontend.css
                    "<%= DestPath %>/css/style.css": "<%= SourcesPath %>/less/style.less",
                    "<%= DestPath %>/css/bootstrap.css": "<%= SourcesPath %>/less/bootstrap.less"
                    //compiling backend.less into backend.css
                   "<%= DestPath %>/css/backend.css":"<%= SourcesPath %>/less/backend.less"
                }
            }
        },

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question