{"action":"created","issue":{"url":"https://api.github.com/repos/davezuko/react-redux-starter-kit/issues/160","labels_url":"https://api.github.com/repos/davezuko/react-redux-starter-kit/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/davezuko/react-redux-starter-kit/issues/160/comments","events_url":"https://api.github.com/repos/davezuko/react-redux-starter-kit/issues/160/events","html_url":"https://github.com/davezuko/react-redux-starter-kit/issues/160","id":115009089,"number":160,"title":"Implement application configuration base on build environment","user":{"login":"imanhodjaev","id":354868,"avatar_url":"https://avatars.githubusercontent.com/u/354868?v=3","gravatar_id":"","url":"https://api.github.com/users/imanhodjaev","html_url":"https://github.com/imanhodjaev","followers_url":"https://api.github.com/users/imanhodjaev/followers","following_url":"https://api.github.com/users/imanhodjaev/following{/other_user}","gists_url":"https://api.github.com/users/imanhodjaev/gists{/gist_id}","starred_url":"https://api.github.com/users/imanhodjaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imanhodjaev/subscriptions","organizations_url":"https://api.github.com/users/imanhodjaev/orgs","repos_url":"https://api.github.com/users/imanhodjaev/repos","events_url":"https://api.github.com/users/imanhodjaev/events{/privacy}","received_events_url":"https://api.github.com/users/imanhodjaev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/davezuko/react-redux-starter-kit/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-04T09:26:36Z","updated_at":"2015-11-06T04:37:17Z","closed_at":null,"body":"Hi,\r\n\r\nI will be very happy to implement this improvement so users can use environment based application (in browser) configuration \r\n\r\n```es6\r\nimport config from 'app-config';\r\n```\r\n\r\nPossible points for implementation need to modify https://github.com/davezuko/react-redux-starter-kit/blob/master/config/index.js and change this\r\n\r\n1. Create a folder with application configuration in `config` directory,\r\n2. Add  `config.set('app_config', 'config/application');`,\r\n3. Add `app_config      : project.bind(null, config.get('app_config'))` to `paths`\r\n\r\nChange this\r\n```es6\r\nconfig.set('utils_aliases', [\r\n  'actions',\r\n  'components',\r\n  'constants',\r\n  'containers',\r\n  'layouts',\r\n  'reducers',\r\n  'routes',\r\n  'services',\r\n  'styles',\r\n  'utils',\r\n  'views'\r\n].reduce((acc, dir) => ((acc[dir] = paths.src(dir)) && acc), {}));\r\n```\r\n\r\nto \r\n\r\n```es6\r\nconfig.set('utils_aliases',\r\n  [\r\n    'actions',\r\n    'components',\r\n    'constants',\r\n    'containers',\r\n    'layouts',\r\n    'reducers',\r\n    'routes',\r\n    'services',\r\n    'styles',\r\n    'utils',\r\n    'views',\r\n    'config'\r\n  ].reduce(\r\n    (acc, x) => {\r\n      if (x === 'config') {\r\n        return ((acc[x] = paths.app_config(env)) && acc);\r\n      }\r\n\r\n      return ((acc[x] = paths.src(x)) && acc);\r\n    },  {}\r\n  )\r\n);\r\n```\r\n\r\nOr to\r\n\r\n```es6\r\nlet module_alases = [\r\n    'actions',\r\n    'components',\r\n    'constants',\r\n    'containers',\r\n    'layouts',\r\n    'reducers',\r\n    'routes',\r\n    'services',\r\n    'styles',\r\n    'utils',\r\n    'views'\r\n].reduce((acc, dir) => ((acc[dir] = paths.src(dir)) && acc), {}));\r\n\r\nmodule_alases['app-config'] = paths.app_config(dir);\r\n\r\nconfig.set('utils_aliases', module_alases);\r\n```\r\n\r\nWhat do you think please advise."},"comment":{"url":"https://api.github.com/repos/davezuko/react-redux-starter-kit/issues/comments/154283573","html_url":"https://github.com/davezuko/react-redux-starter-kit/issues/160#issuecomment-154283573","issue_url":"https://api.github.com/repos/davezuko/react-redux-starter-kit/issues/160","id":154283573,"user":{"login":"imanhodjaev","id":354868,"avatar_url":"https://avatars.githubusercontent.com/u/354868?v=3","gravatar_id":"","url":"https://api.github.com/users/imanhodjaev","html_url":"https://github.com/imanhodjaev","followers_url":"https://api.github.com/users/imanhodjaev/followers","following_url":"https://api.github.com/users/imanhodjaev/following{/other_user}","gists_url":"https://api.github.com/users/imanhodjaev/gists{/gist_id}","starred_url":"https://api.github.com/users/imanhodjaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imanhodjaev/subscriptions","organizations_url":"https://api.github.com/users/imanhodjaev/orgs","repos_url":"https://api.github.com/users/imanhodjaev/repos","events_url":"https://api.github.com/users/imanhodjaev/events{/privacy}","received_events_url":"https://api.github.com/users/imanhodjaev/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T04:37:17Z","updated_at":"2015-11-06T04:37:17Z","body":"@davezuko sure we can keep application configuration inside `src` directory.\r\nI am agree with you that keeping configuration outside of `src` will confuse people.\r\nThe main idea of this proposal was to be able to separate configuration while developing and  deploying production ready configuration relying on `NODE_ENV=development | production | etc.` \r\n\r\n```\r\nsrc\r\n   config\r\n         development.js\r\n         production.js\r\n```"}}