{"action":"created","issue":{"url":"https://api.github.com/repos/insin/nwb/issues/124","repository_url":"https://api.github.com/repos/insin/nwb","labels_url":"https://api.github.com/repos/insin/nwb/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/insin/nwb/issues/124/comments","events_url":"https://api.github.com/repos/insin/nwb/issues/124/events","html_url":"https://github.com/insin/nwb/issues/124","id":162285714,"number":124,"title":"Add support for creating a preact-compat build","user":{"login":"insin","id":226692,"avatar_url":"https://avatars.githubusercontent.com/u/226692?v=3","gravatar_id":"","url":"https://api.github.com/users/insin","html_url":"https://github.com/insin","followers_url":"https://api.github.com/users/insin/followers","following_url":"https://api.github.com/users/insin/following{/other_user}","gists_url":"https://api.github.com/users/insin/gists{/gist_id}","starred_url":"https://api.github.com/users/insin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/insin/subscriptions","organizations_url":"https://api.github.com/users/insin/orgs","repos_url":"https://api.github.com/users/insin/repos","events_url":"https://api.github.com/users/insin/events{/privacy}","received_events_url":"https://api.github.com/users/insin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/insin/nwb/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-06-25T15:16:12Z","updated_at":"2016-07-08T01:48:57Z","closed_at":null,"body":"@developit's [preact-compat](https://github.com/developit/preact-compat) is a drop-in way to try [preact](https://github.com/developit/preact) with a React app - if it's compatible with your app, having support for it in react-specific build commands would be an easy way to shave size off your production build.\r\n\r\nThe actual change here should be making the following tweaks to [build-react-app.js](https://github.com/insin/nwb/blob/next/src/commands/build-react-app.js) and [build-react.js](https://github.com/insin/nwb/blob/next/src/commands/build-react.js):\r\n\r\n- [x] If a `--preact` flag is present, add [this `resolve.alias` config](https://github.com/developit/preact-compat#usage-with-webpack) to the base Webpack config\r\n- [x] If a `--preact` flag is present, don't configure React inline and constant element transforms for production builds"},"comment":{"url":"https://api.github.com/repos/insin/nwb/issues/comments/231256064","html_url":"https://github.com/insin/nwb/issues/124#issuecomment-231256064","issue_url":"https://api.github.com/repos/insin/nwb/issues/124","id":231256064,"user":{"login":"insin","id":226692,"avatar_url":"https://avatars.githubusercontent.com/u/226692?v=3","gravatar_id":"","url":"https://api.github.com/users/insin","html_url":"https://github.com/insin","followers_url":"https://api.github.com/users/insin/followers","following_url":"https://api.github.com/users/insin/following{/other_user}","gists_url":"https://api.github.com/users/insin/gists{/gist_id}","starred_url":"https://api.github.com/users/insin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/insin/subscriptions","organizations_url":"https://api.github.com/users/insin/orgs","repos_url":"https://api.github.com/users/insin/repos","events_url":"https://api.github.com/users/insin/events{/privacy}","received_events_url":"https://api.github.com/users/insin/received_events","type":"User","site_admin":false},"created_at":"2016-07-08T01:48:57Z","updated_at":"2016-07-08T01:48:57Z","body":":+1: got it working, but I had to fiddle with `preact-compat`'s `package.json` in `node_modules/` and delete its own installed version of `preact` to make it use my app's `preact@beta`, and for that not to be peer invalid (with npm2):\r\n\r\n```json\r\n  \"peerDependencies\": {\r\n    \"preact\": \"* || ^5.1.0-beta.20\",\r\n    \"proptypes\": \"*\"\r\n  },\r\n  \"dependencies\": {\r\n    \"preact-render-to-string\": \"^2.6.1\",\r\n    \"preact-svg\": \"^1.6.0\"\r\n  },\r\n```\r\n\r\nA dependency should usually be in either `peerDependencies` or `dependencies`/`optionalDependencies`, but not both as the latter will make it install its own version and the `*` version not matching prerelease versions makes it a pain when you need to be on the bleeding edge :smile_cat: "}}
{"actor":{"display_login":"insin"}}