Closed danielkcz closed 9 years ago
Hi @FredyC, you can try to use postProcess
functionality for this
or you can also try something like this:
module.exports = files: ['common/config/*.cson', '<%= client.config %>']
and then just pass clients config into data
:
require('load-grunt-config')(grunt, {
//...
data: {
client: { ... }
}
//...
}
Yeah, I have pretty much ended with something similar like that. However I had also found recursive-merge which can handle array values properly. I think it would be more convenient for loading configuration files. Would you consider adding option to specify actual merging function?
I'm not the one who is making decisions ;)
P.S.: I think, recursive merging will increase build time.
Well I think that having clear solution of how config files are structured wins over the performance. Either way, already working on pull request so it can be configurable :)
Here is the use case. I have directory with base and client specific configuration files and I want to merge them together in a single config for grunt to run. The base configuration can be like this:
The client specific is similar, but different directories are used obviously. I want to merge these two so resulting
files
contains paths from both sources. Unfortunately result contains only client specific paths. Sadly it is the way how lodash merge works ... http://jsbin.com/vofocakabi/1/I am wondering what would be good way how to overcome this. I was thinking about handling it in common config by looking it there is any existing configuration and merge it by myself, but in that time the configuration is not available yet.