{"action":"created","issue":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/900","repository_url":"https://api.github.com/repos/facebookincubator/create-react-app","labels_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/900/labels{/name}","comments_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/900/comments","events_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/900/events","html_url":"https://github.com/facebookincubator/create-react-app/issues/900","id":182883185,"number":900,"title":"Support custom babel presets & plugins via environment variables","user":{"login":"philiptzou","id":809865,"avatar_url":"https://avatars.githubusercontent.com/u/809865?v=3","gravatar_id":"","url":"https://api.github.com/users/philiptzou","html_url":"https://github.com/philiptzou","followers_url":"https://api.github.com/users/philiptzou/followers","following_url":"https://api.github.com/users/philiptzou/following{/other_user}","gists_url":"https://api.github.com/users/philiptzou/gists{/gist_id}","starred_url":"https://api.github.com/users/philiptzou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philiptzou/subscriptions","organizations_url":"https://api.github.com/users/philiptzou/orgs","repos_url":"https://api.github.com/users/philiptzou/repos","events_url":"https://api.github.com/users/philiptzou/events{/privacy}","received_events_url":"https://api.github.com/users/philiptzou/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-10-13T19:48:30Z","updated_at":"2016-12-05T22:49:10Z","closed_at":"2016-10-13T20:11:27Z","body":"Hello, I found an easy way to enable additional presets & plugins in [my fork of react-scripts](https://github.com/philiptzou/create-react-app). I want to share it with others and the maintainer of this original repository may find this feature useful and add it to the main `react-scripts`.\n\nBasically, [what I did](https://github.com/philiptzou/create-react-app/commit/e48b4f4f0df4c5bcd4e3450263ef33837602b9f3) was just introducing two environment variables BABEL_PRESETS and BABEL_PLUGINS, which accept JSON encoded list of path strings. Users can enable any kind of presets/plugins by specify those two variables before they run `npm start`.\n\nFor example, I need to enable `react-relay` support. What I did is just execute this command before I start the development server:\n\n``` sh\nexport BABEL_PLUGINS=\"[\\\"`pwd`/plugins/relay-plugin.js\\\"]\"\n```\n\nWith my forked react-scripts ([`@philiptzou/react-scripts`](https://www.npmjs.com/package/@philiptzou/react-scripts)) and other related relay packages installed, the webpack server is able to handle `Relay.QL` syntax now.\n\nI just noticed that we can use `.env` file to specify `REACT_APP_` initial variables. It maybe a more elegant way to do this in the future.\n"},"comment":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/comments/265003434","html_url":"https://github.com/facebookincubator/create-react-app/issues/900#issuecomment-265003434","issue_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/900","id":265003434,"user":{"login":"spudly","id":487068,"avatar_url":"https://avatars.githubusercontent.com/u/487068?v=3","gravatar_id":"","url":"https://api.github.com/users/spudly","html_url":"https://github.com/spudly","followers_url":"https://api.github.com/users/spudly/followers","following_url":"https://api.github.com/users/spudly/following{/other_user}","gists_url":"https://api.github.com/users/spudly/gists{/gist_id}","starred_url":"https://api.github.com/users/spudly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spudly/subscriptions","organizations_url":"https://api.github.com/users/spudly/orgs","repos_url":"https://api.github.com/users/spudly/repos","events_url":"https://api.github.com/users/spudly/events{/privacy}","received_events_url":"https://api.github.com/users/spudly/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T22:49:10Z","updated_at":"2016-12-05T22:49:10Z","body":"Because I don't want to override the webpack config completely, just the Babel config.\r\n\r\nThat's why I suggest that we could just allow Babel to use the Babel if it exists. If it doesn't exist, it'll continue to use the default preset."}}
{"actor":{"display_login":"spudly"}}