firstandthird / load-grunt-config

Grunt plugin that lets you break up your Gruntfile config by task
firstandthird.github.io/load-grunt-config/
MIT License
374 stars 64 forks source link

Issue loading tasks. #54

Closed KarlPurk closed 10 years ago

KarlPurk commented 10 years ago

Hi.

I have run into problems using load-grunt-config with tasks such as grunt-regex-replace and grunt-html-snapshots.

I have had success with the following tasks:

But I have had difficulties with these tasks:

I did manage to get grunt-regex-replace to work by adding the following to my Gruntfile.js file:

grunt.loadNpmTasks('grunt-regex-replace');

After adding the above to my Gruntfile.js the task ran as expected and the config was loaded from grunt/regex-replace.js.

However the same approach did not work for grunt-html-snapshots and in this case, I had to also include the config inside the Gruntfile.js file (essentially bypassing load-grunt-config completely for this particular task).

Example

Gruntfile.js

module.exports = function(grunt) {      
    require('load-grunt-config')(grunt);
};                                      

package.json (truncated)

{                                                         
  ...
  "dependencies": {                                       
    "load-grunt-config": "~0.8.0-beta.1"                  
  },                                                      
  "devDependencies": {                                    
    "load-grunt-config": "^0.8.0-beta.1",                 
    "grunt-html-snapshots": "^0.2.0"                      
  },                                                      
  ...
}                                                         

aliases.yaml

default:            
 - 'html-snapshots' 

I can verify that there is also a html-snapshots.js file in the grunt folder.

$ ls grunt                        
aliases.yaml  html-snapshots.js   

I haven't included the contents of this file because I don't believe it's relevant?

Thanks!

jgallen23 commented 10 years ago

@KarlPurk are you still having issues with this?

KarlPurk commented 10 years ago

@jgallen23 I don't think this is an issue. I think I this was just a case of using the wrong format for the task names in the aliases.yaml file. I think changing the 'html-snapshots' to 'htmlSnapshots' should fix the issue but can't confirm at the moment. Closing the issue for now and will reopen if required. Thanks.