Increase grunt compile performance to 6 second

http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/css-topics/css_debug.html

If you have a problem with slow response for grunt to manage that we changed somethings, here is a solution.

First of all we will stop rely on grunt watch itself and we will bring to work PHPStorm instead which is much faster in that case.

  1. Stop using “grunt watch” command, exit if it’s working.
  2. In PHPStorm go to “PhpStorm -> Preferences -> Tools -> File Watchers”
  3. Click on plus icon and add <custom>
  4. “Program” path is correct when you have your grunt installed globally so please do that or change to your grunt path.
  5. That same for for “Working directory”.
  6. Select options like on image below

 

5. Next to “Scope” please click “…”, select your theme folder if you have a module or folder in frontend directory and click “Include Recursively”, then click OK.

6. Now you can Apply, click OK and go back to editor.

7. Open your Gruntfile.js

8. Add grunt task to your default function like on the example below and change “sova” to your theme name.

default: function () {

    grunt.task.run(‘less:sova’);

},

9. Now when you will change anything in your theme, you will see console and your files will be compiled in something about 5-6second instead of 15-25.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s