0

If I install the npm project and grunt config that ships with Magento 2 -- I'm able to run commands like

grunt clean
grunt clean:var
etc.

However, if I run grunt --help

Grunt: The JavaScript Task Runner (v0.4.5)

/* ... */
Available tasks
 black-list-generator  Custom task.                                            
     clean-black-list  Custom task.                                            
               deploy  Custom task.                                            
          mage-minify  Minify files with a various compressor engines *        
               static  Custom task.                                            
              default  Custom task.                                            
                 prod  Custom task.                                            
              refresh  Custom task.                                            
        documentation  Alias for "replace:documentation", "less:documentation",
                       "styledocco:documentation",                             
                       "usebanner:documentationCss",                           
                       "usebanner:documentationLess",                          
                       "usebanner:documentationHtml", "clean:var", "clean:pub" 
                       tasks.                                                  
         legacy-build  Alias for "mage-minify:legacy" task.                    
                 spec  Custom task.                                            

/* ... */

The clean task does not show in the list of avaiable tasks.

Why is this? Is clean not a task? If not, what is it? If so, is there a way to get a full task list?

A shorter version of this question: What's the deal with grunt?

1 Answer 1

2

Grunt is configuration oriented task runner, which means that you can create just a config and it will be automatically converted to a task, which apparently seems to be ignored by --help flag, to your convenience ofc :)

To help you get how Grunt works. You have to combine all these files and directories to get the full image of available tasks:

  • Gruntfile.js - that's the main file
  • dev/tools/grunt/tasks - tasks itself
  • dev/tools/grunt/configs - config files which are taken as tasks (both JS and JSON)
  • dev/tools/grunt/tools - helpers functions

PS. Yes, I hate Grunt so much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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