0

M2 has a grunt / LESS workflow that allows you to automatically compile and view your changes in the browser. However, I can rarely get the live reload to work with the Chrome extension, and when it does work (which is super rare) it takes soooo long to compile. Has anyone out there found a more efficient way to write LESS for M2? Is there a way to use Gulp, while still utilizing M2's fallback system and variables? Is there a trick to speeding up Grunt's compilation and ensuring live reload works?

  • Magento Version: 2.1.7
  • Dev Environment: Vagrant / VM,
  • Ubuntu, php 5.6
  • Client Side Compile: On
2
  • I gave up trying to get live reload to work with chrome, having the same results as you. But when i do grunt watch and reload the browser myself, i get about 2 seconds from save to reload. what are you getting on your end? – circlesix Jul 24 '17 at 1:01
  • 1
    Grunt watch usually takes at least 2 or 3 seconds to even start the compilation process for me. I found a really good gulp workaround though. If you watch and work off of the style-l.less and style-m.less files in the var/view_processed directory, you can use live reload. Compilation is also really quick. If you write a function to copy files from var/view_processed into your theme on updates, you can deploy static content without losing anything. – Harry Manback Jul 25 '17 at 2:02
1

Yes sure you can find many examples to configure gulp for Magento 2. Here is similar question How to Configure Magento2 with Gulp instead Grunt.

But I do not see the problem to use grunt tool. Of course if you not going to click F5 every sec.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.