-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overriding Values? #41
Comments
Hi, currently you can't override the constants from multiple configuration files only using gulp-ng-constant. However, one solution would be to do the overriding outside the plugin and then pass the properties to it, similar to the multiple environments example var gulp = require('gulp');
var ngConstant = require('gulp-ng-constant');
gulp.task('constants', function () {
var appConfig = require('./app.config.json');
var devConfig = require('./app.dev.config.json');
var finalConfig = Object.assign(appConfig, devConfig);
return ngConstant({
constants: finalConfig,
stream: true
})
.pipe(gulp.dest('dist'));
}); Please note that instead of passing this plugin into a pipe, you use the Let me know if this helps you |
Thank you! I actually ended up doing something very similar to what you described. I On Thursday, September 29, 2016, Arturo Guzman notifications@github.com
|
Hi:
I would like to have a base set of config values, and then override only certain values in an environment-specific config. I'm having hard time figuring out how to get gulp-ng-constant to do that. Can you give me a hint.
Example:
app.config.json would look like this:
{
"foo": "default",
"bar": "default"
}
app.dev.json might look like this:
{
"foo":"dev"
}
I want output to look like this
.constant("foo", "dev")
.constant("bar": "default")
I can't seem to make that work. (either app.dev.json completely overwrites app.config.json, so "bar" gets dropped, or app.config.json completely overwrites app.dev.json)
The text was updated successfully, but these errors were encountered: