{"action":"created","comment":{"url":"https://api.github.com/repos/mapbox/underreact/pulls/comments/208829545","pull_request_review_id":144718190,"id":208829545,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODgyOTU0NQ==","diff_hunk":"@@ -106,12 +147,16 @@ function defineServeStatic(y) {\n }\n \n function runServeStatic(argv) {\n-  config('serve-static', argv)\n+  const serveStatic = require('../commands/serve-static');\n+  const config = require('../lib/config');","path":"bin/underreact.js","position":121,"original_position":121,"commit_id":"b14fed5edf90cab492280ed046d37524511efb1e","original_commit_id":"b14fed5edf90cab492280ed046d37524511efb1e","user":{"login":"kepta","id":6966254,"node_id":"MDQ6VXNlcjY5NjYyNTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6966254?v=4","gravatar_id":"","url":"https://api.github.com/users/kepta","html_url":"https://github.com/kepta","followers_url":"https://api.github.com/users/kepta/followers","following_url":"https://api.github.com/users/kepta/following{/other_user}","gists_url":"https://api.github.com/users/kepta/gists{/gist_id}","starred_url":"https://api.github.com/users/kepta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kepta/subscriptions","organizations_url":"https://api.github.com/users/kepta/orgs","repos_url":"https://api.github.com/users/kepta/repos","events_url":"https://api.github.com/users/kepta/events{/privacy}","received_events_url":"https://api.github.com/users/kepta/received_events","type":"User","site_admin":false},"body":"The problem with requiring it at the top of file would mean that it wouldn't get the necessary `env` variable setup, leading to unpredictability. Hence I am trying to defer most of the `require`s until the [middleware](https://github.com/mapbox/underreact/pull/21/files#diff-ecf66e53d7f5563584528930a084b7f4R15) has executed, in order to setup the necessary `env` vars.","created_at":"2018-08-09T07:25:24Z","updated_at":"2018-08-09T07:25:24Z","html_url":"https://github.com/mapbox/underreact/pull/21#discussion_r208829545","pull_request_url":"https://api.github.com/repos/mapbox/underreact/pulls/21","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mapbox/underreact/pulls/comments/208829545"},"html":{"href":"https://github.com/mapbox/underreact/pull/21#discussion_r208829545"},"pull_request":{"href":"https://api.github.com/repos/mapbox/underreact/pulls/21"}},"in_reply_to_id":208705159},"pull_request":{"url":"https://api.github.com/repos/mapbox/underreact/pulls/21","id":207088922,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3MDg4OTIy","html_url":"https://github.com/mapbox/underreact/pull/21","diff_url":"https://github.com/mapbox/underreact/pull/21.diff","patch_url":"https://github.com/mapbox/underreact/pull/21.patch","issue_url":"https://api.github.com/repos/mapbox/underreact/issues/21","number":21,"state":"open","locked":false,"title":"Enable env variables","user":{"login":"kepta","id":6966254,"node_id":"MDQ6VXNlcjY5NjYyNTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6966254?v=4","gravatar_id":"","url":"https://api.github.com/users/kepta","html_url":"https://github.com/kepta","followers_url":"https://api.github.com/users/kepta/followers","following_url":"https://api.github.com/users/kepta/following{/other_user}","gists_url":"https://api.github.com/users/kepta/gists{/gist_id}","starred_url":"https://api.github.com/users/kepta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kepta/subscriptions","organizations_url":"https://api.github.com/users/kepta/orgs","repos_url":"https://api.github.com/users/kepta/repos","events_url":"https://api.github.com/users/kepta/events{/privacy}","received_events_url":"https://api.github.com/users/kepta/received_events","type":"User","site_admin":false},"body":"This enables the use of `.env` files following the algorithm [here](https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use). This works similar to how [create-react-app](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-development-environment-variables-in-env) handles env vars.\r\n\r\nThis also adds the option of passing `mode` option via CLI, this would either be `development` or `production`. The current problem I am facing when running `npx underreact start -m=production` is that the `html-compiler` is not correctly able to serve CSS passed through `underreact.config.js`.\r\n\r\nI feel the problem lies somewhere [here](https://github.com/mapbox/underreact/blob/b14fed5edf90cab492280ed046d37524511efb1e/lib/html-compiler.js#L30). In the `start` command [this function](https://github.com/mapbox/underreact/blob/b14fed5edf90cab492280ed046d37524511efb1e/lib/html-compiler.js#L13) is not called with `cssFilename` and [cssAssets](https://github.com/mapbox/underreact/blob/b14fed5edf90cab492280ed046d37524511efb1e/lib/html-compiler.js#L41) ends up missing the file compiled by postCSS plugin. Thoughts?\r\n\r\nWill add documentation regarding this in the next PR.\r\n\r\n@davidtheclark for review, please.","created_at":"2018-08-08T17:56:23Z","updated_at":"2018-08-09T07:25:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e658625f6e80381e220a86b1254f35b032c24ce0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapbox/underreact/pulls/21/commits","review_comments_url":"https://api.github.com/repos/mapbox/underreact/pulls/21/comments","review_comment_url":"https://api.github.com/repos/mapbox/underreact/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapbox/underreact/issues/21/comments","statuses_url":"https://api.github.com/repos/mapbox/underreact/statuses/b14fed5edf90cab492280ed046d37524511efb1e","head":{"label":"mapbox:env","ref":"env","sha":"b14fed5edf90cab492280ed046d37524511efb1e","user":{"login":"mapbox","id":600935,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMDkzNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":139043818,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkwNDM4MTg=","name":"underreact","full_name":"mapbox/underreact","owner":{"login":"mapbox","id":600935,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMDkzNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/underreact","description":"Work-in-progress React app build system","fork":false,"url":"https://api.github.com/repos/mapbox/underreact","forks_url":"https://api.github.com/repos/mapbox/underreact/forks","keys_url":"https://api.github.com/repos/mapbox/underreact/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/underreact/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/underreact/teams","hooks_url":"https://api.github.com/repos/mapbox/underreact/hooks","issue_events_url":"https://api.github.com/repos/mapbox/underreact/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/underreact/events","assignees_url":"https://api.github.com/repos/mapbox/underreact/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/underreact/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/underreact/tags","blobs_url":"https://api.github.com/repos/mapbox/underreact/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/underreact/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/underreact/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/underreact/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/underreact/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/underreact/languages","stargazers_url":"https://api.github.com/repos/mapbox/underreact/stargazers","contributors_url":"https://api.github.com/repos/mapbox/underreact/contributors","subscribers_url":"https://api.github.com/repos/mapbox/underreact/subscribers","subscription_url":"https://api.github.com/repos/mapbox/underreact/subscription","commits_url":"https://api.github.com/repos/mapbox/underreact/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/underreact/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/underreact/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/underreact/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/underreact/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/underreact/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/underreact/merges","archive_url":"https://api.github.com/repos/mapbox/underreact/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/underreact/downloads","issues_url":"https://api.github.com/repos/mapbox/underreact/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/underreact/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/underreact/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/underreact/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/underreact/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/underreact/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/underreact/deployments","created_at":"2018-06-28T16:32:57Z","updated_at":"2018-07-05T01:55:58Z","pushed_at":"2018-08-08T18:00:00Z","git_url":"git://github.com/mapbox/underreact.git","ssh_url":"git@github.com:mapbox/underreact.git","clone_url":"https://github.com/mapbox/underreact.git","svn_url":"https://github.com/mapbox/underreact","homepage":"","size":548,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":8,"watchers":2,"default_branch":"master"}},"base":{"label":"mapbox:next","ref":"next","sha":"6508b868fc13cc57e7d9744068a6a2bfa7c9ee58","user":{"login":"mapbox","id":600935,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMDkzNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":139043818,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkwNDM4MTg=","name":"underreact","full_name":"mapbox/underreact","owner":{"login":"mapbox","id":600935,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMDkzNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/underreact","description":"Work-in-progress React app build system","fork":false,"url":"https://api.github.com/repos/mapbox/underreact","forks_url":"https://api.github.com/repos/mapbox/underreact/forks","keys_url":"https://api.github.com/repos/mapbox/underreact/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/underreact/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/underreact/teams","hooks_url":"https://api.github.com/repos/mapbox/underreact/hooks","issue_events_url":"https://api.github.com/repos/mapbox/underreact/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/underreact/events","assignees_url":"https://api.github.com/repos/mapbox/underreact/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/underreact/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/underreact/tags","blobs_url":"https://api.github.com/repos/mapbox/underreact/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/underreact/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/underreact/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/underreact/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/underreact/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/underreact/languages","stargazers_url":"https://api.github.com/repos/mapbox/underreact/stargazers","contributors_url":"https://api.github.com/repos/mapbox/underreact/contributors","subscribers_url":"https://api.github.com/repos/mapbox/underreact/subscribers","subscription_url":"https://api.github.com/repos/mapbox/underreact/subscription","commits_url":"https://api.github.com/repos/mapbox/underreact/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/underreact/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/underreact/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/underreact/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/underreact/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/underreact/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/underreact/merges","archive_url":"https://api.github.com/repos/mapbox/underreact/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/underreact/downloads","issues_url":"https://api.github.com/repos/mapbox/underreact/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/underreact/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/underreact/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/underreact/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/underreact/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/underreact/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/underreact/deployments","created_at":"2018-06-28T16:32:57Z","updated_at":"2018-07-05T01:55:58Z","pushed_at":"2018-08-08T18:00:00Z","git_url":"git://github.com/mapbox/underreact.git","ssh_url":"git@github.com:mapbox/underreact.git","clone_url":"https://github.com/mapbox/underreact.git","svn_url":"https://github.com/mapbox/underreact","homepage":"","size":548,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":8,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapbox/underreact/pulls/21"},"html":{"href":"https://github.com/mapbox/underreact/pull/21"},"issue":{"href":"https://api.github.com/repos/mapbox/underreact/issues/21"},"comments":{"href":"https://api.github.com/repos/mapbox/underreact/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/mapbox/underreact/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/mapbox/underreact/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapbox/underreact/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/mapbox/underreact/statuses/b14fed5edf90cab492280ed046d37524511efb1e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"kepta"}}