Skip to content

Load task configs from multiple folders #76

@ghost

Description

I'm trying to make my grunt tasks (and thus the task configs) more modular with component.io, and was wondering if load-grunt-config can or could support loading the tasks from multiple folders.

With something like:

// glob
configPath: path.join(process.cwd(), 'components/**/*.js'),

or:

// array of folders or .js files
configPath: ['components/task1/concat.js', 'components/task2/uglify.js'],

Would something like that be at all attainable? I would have a separate function take care of this, but since configPath expects a single path there is not really a way to modify the behaviour without modifying the load-grunt-config source code.

In my opinion my proposed change would allow for an easier syntax for the override too, where you could just override the previous config like so:

// last config passed takes precedence
configs: ['components/concatdefault/concat.js', 'lib/concatoverride/concat.js'],

Quickly looking through the source code tells me that this could be possible. Any ideas on the best way to do this / possible downsides?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions