Closed jmeiss closed 9 years ago
Hi pal,
Thanks for your feedback i need to think how can implement this feature ... stay in touch ...
You could try the following example:
var merge = require('merge');
grunt.initConfig({
replace: {
dev: {
options: {
patterns: [
{
json: merge(
grunt.file.readJSON('./config/default.json'),
grunt.file.readJSON('./config/dev.json')
)
}
]
},
files: [
{expand: true, flatten: true, src: ['test/dev.json'], dest: 'tmp/'}
]
},
prod: {
options: {
patterns: [
{
json: merge(
grunt.file.readJSON('./config/default.json'),
grunt.file.readJSON('./config/prod.json')
)
}
]
},
files: [
{expand: true, flatten: true, src: ['test/prod.json'], dest: 'tmp/'}
]
}
}
});
Please ... tell me if it fits in your scenario, thks !!!
Pal any updates, It was useful example ??
No updates, closing for now ...
Hi guys!
I'm using replace and I really like it! It's an awesome package to generate my environment conf but I've found any way to get a default config file and a specific environment config file that will override default config file.
Ex:
config-default.json
config-dev.json
config-prod.json
should generate:
dev.json
prod.json
Is there any way to do that?
Thanks for your help