{"action":"created","issue":{"url":"https://api.github.com/repos/guzart/gulp-ng-constant/issues/22","labels_url":"https://api.github.com/repos/guzart/gulp-ng-constant/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/guzart/gulp-ng-constant/issues/22/comments","events_url":"https://api.github.com/repos/guzart/gulp-ng-constant/issues/22/events","html_url":"https://github.com/guzart/gulp-ng-constant/issues/22","id":100912639,"number":22,"title":"Constants replaced instead of merged","user":{"login":"sdornan","id":563517,"avatar_url":"https://avatars.githubusercontent.com/u/563517?v=3","gravatar_id":"","url":"https://api.github.com/users/sdornan","html_url":"https://github.com/sdornan","followers_url":"https://api.github.com/users/sdornan/followers","following_url":"https://api.github.com/users/sdornan/following{/other_user}","gists_url":"https://api.github.com/users/sdornan/gists{/gist_id}","starred_url":"https://api.github.com/users/sdornan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdornan/subscriptions","organizations_url":"https://api.github.com/users/sdornan/orgs","repos_url":"https://api.github.com/users/sdornan/repos","events_url":"https://api.github.com/users/sdornan/events{/privacy}","received_events_url":"https://api.github.com/users/sdornan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-14T02:08:45Z","updated_at":"2015-09-04T03:43:28Z","closed_at":"2015-09-04T03:43:28Z","body":"I have a gulp-ng-constant task like this:\r\n```javascript\r\ngulp.task('config', function() {\r\n  var configPath = 'env.json';\r\n\r\n  return gulp.src(configPath)\r\n    .pipe($.ngConstant({\r\n      name: 'app.env',\r\n      constants: { env: { authPath: /profiles/authenticate/ } },\r\n      wrap: 'commonjs'\r\n    }))\r\n    .pipe(gulp.dest(path.join(conf.paths.src, '/app')));\r\n});\r\n```\r\n\r\nand an env.json file like this:\r\n```json\r\n{\r\n  \"env\": {\r\n    \"backend\": \"http://0.0.0.0:8000\",\r\n  }\r\n}\r\n```\r\n\r\nGiven those parameters, I end up with an env.js file like this:\r\n```javascript\r\nmodule.exports = angular.module(\"app.env\", [])\r\n\r\n.constant(\"env\", {\r\n\t\"authPath\": \"/profiles/authenticate/\"\r\n})\r\n\r\n;\r\n```\r\n\r\nI expected the constants in the json file to be merged rather than replaced since an extra variable isn't likely to cause problems vs. a missing variable. Agree, disagree?"},"comment":{"url":"https://api.github.com/repos/guzart/gulp-ng-constant/issues/comments/137642526","html_url":"https://github.com/guzart/gulp-ng-constant/issues/22#issuecomment-137642526","issue_url":"https://api.github.com/repos/guzart/gulp-ng-constant/issues/22","id":137642526,"user":{"login":"guzart","id":247952,"avatar_url":"https://avatars.githubusercontent.com/u/247952?v=3","gravatar_id":"","url":"https://api.github.com/users/guzart","html_url":"https://github.com/guzart","followers_url":"https://api.github.com/users/guzart/followers","following_url":"https://api.github.com/users/guzart/following{/other_user}","gists_url":"https://api.github.com/users/guzart/gists{/gist_id}","starred_url":"https://api.github.com/users/guzart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guzart/subscriptions","organizations_url":"https://api.github.com/users/guzart/orgs","repos_url":"https://api.github.com/users/guzart/repos","events_url":"https://api.github.com/users/guzart/events{/privacy}","received_events_url":"https://api.github.com/users/guzart/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T03:43:28Z","updated_at":"2015-09-04T03:43:28Z","body":"I don't think it should be the default behaviour, but I've added a `merge` option you can set it to true for merging. Let's see how it works."}}