Magento – Magento2 development and speed of compilation

frontendmagento2

I have a lot of experience working with both, Magento 1, as all front-end tools like less, grunt and so on.

But now working in Magento2 i have some concerns i've not been able to solve this weekend. I've been searching like crazy. I do hear many other developers experiencing the same.

The bottom line of the issue is. The site is slow. (10sec load times per page is not strange)

I walked through the entire devdocs of magento.
But in production mode Magento re-generated the CSS and such. But this taks a huge amount of time. I used Vagrant and Digital ocean server. Even though Digital Ocean is quicker its not useable to develop on.

Whats the best way to proceed?

Best Answer

I am also fronted developer and facing same problem, it's because of server side compilation mode.

Please try following method, may be it's helpful and you don't need grunt cmd also so it's save your time also

go to

store > Configuration > Advanced > Developer > Front-end development workflow 

and change workflow type to Client side less compilation

Now go to your Magento installed directory and manually delete following folders

 1. pub\static\frontend\Magento  (remove all theme folders)

 2. var\ (remove all items)

now edit any less file and check it.

no need to run any grunt CMD direct Refresh your browser may be it's working fine.

also please install below add-on in firefox

https://addons.mozilla.org/en-US/firefox/user/simonedeponti/?src=api

it's show you direct less file path in browser when you inspect elements.

I think it's better way to save time.

Related Topic