{"action":"opened","issue":{"url":"https://api.github.com/repos/creynders/load-grunt-configs/issues/23","labels_url":"https://api.github.com/repos/creynders/load-grunt-configs/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/creynders/load-grunt-configs/issues/23/comments","events_url":"https://api.github.com/repos/creynders/load-grunt-configs/issues/23/events","html_url":"https://github.com/creynders/load-grunt-configs/issues/23","id":123248423,"number":23,"title":"Override configs bearing the same name","user":{"login":"varemenos","id":626343,"avatar_url":"https://avatars.githubusercontent.com/u/626343?v=3","gravatar_id":"","url":"https://api.github.com/users/varemenos","html_url":"https://github.com/varemenos","followers_url":"https://api.github.com/users/varemenos/followers","following_url":"https://api.github.com/users/varemenos/following{/other_user}","gists_url":"https://api.github.com/users/varemenos/gists{/gist_id}","starred_url":"https://api.github.com/users/varemenos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varemenos/subscriptions","organizations_url":"https://api.github.com/users/varemenos/orgs","repos_url":"https://api.github.com/users/varemenos/repos","events_url":"https://api.github.com/users/varemenos/events{/privacy}","received_events_url":"https://api.github.com/users/varemenos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-21T10:16:29Z","updated_at":"2015-12-21T10:16:29Z","closed_at":null,"body":"Let me explain the reasoning behind this issue whose theme is basically modularity and code-reuse.\r\n\r\nThe goal is to have a npm package that contains the base of all the grunt task configurations so I don't have to recreate them in each new project, it also makes it very easy to re-use them so I don't have to keep going back to old projects and manually copy/paste the new changes. This helps structure big code bases and maintain large projects that are utilize the same grunt configurations.\r\n\r\nAnd now let me walk you through what I'm trying to do:\r\n\r\nfirst I'm trying to load task configurations from 2 directories like this:\r\n\r\n```js\r\n    var configs = require('load-grunt-configs')(grunt, {\r\n        config: {\r\n            src: [\r\n                'node_modules/my-default-tasks-package/tasks/config/*.js',\r\n                'tasks/config/*.js'\r\n            ]\r\n        }\r\n    });\r\n```\r\n\r\nIn  `node_modules/my-default-tasks-package/tasks/config/` I have all the \"default\" tasks used across multiple projects.\r\nIn `tasks/config/` I have the tasks for this particular project.\r\n\r\nWhat I expected/wished to happen was for load-grunt-configs to load all the  tasks from `./node_modules` and afterwards the ones from `./tasks`. If any of the configurations of `./tasks` already existed in `./node_modules` then they would replace the ones in `./node_modules` (or at least merge them gracefully without combining everything together).\r\n\r\nInstead what I noticed is, load-grunt-configs used `grunt.file.expand` to fetch all the files, then for each of them start placing them in the options variable by using `_.merge`. So in the end the tasks from inside `./node_modules` were merged with the ones in `./tasks`.\r\n\r\nPlease let me know if this makes sense to you and whether it's possible to achieve, also sorry for making you read this big wall of text."}}