{"action":"created","issue":{"url":"https://api.github.com/repos/ericclemmons/npm-install-loader/issues/5","labels_url":"https://api.github.com/repos/ericclemmons/npm-install-loader/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/ericclemmons/npm-install-loader/issues/5/comments","events_url":"https://api.github.com/repos/ericclemmons/npm-install-loader/issues/5/events","html_url":"https://github.com/ericclemmons/npm-install-loader/pull/5","id":124299190,"number":5,"title":"Convert to Webpack Plugin","user":{"login":"ericclemmons","id":15182,"avatar_url":"https://avatars.githubusercontent.com/u/15182?v=3","gravatar_id":"","url":"https://api.github.com/users/ericclemmons","html_url":"https://github.com/ericclemmons","followers_url":"https://api.github.com/users/ericclemmons/followers","following_url":"https://api.github.com/users/ericclemmons/following{/other_user}","gists_url":"https://api.github.com/users/ericclemmons/gists{/gist_id}","starred_url":"https://api.github.com/users/ericclemmons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericclemmons/subscriptions","organizations_url":"https://api.github.com/users/ericclemmons/orgs","repos_url":"https://api.github.com/users/ericclemmons/repos","events_url":"https://api.github.com/users/ericclemmons/events{/privacy}","received_events_url":"https://api.github.com/users/ericclemmons/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ericclemmons/npm-install-loader/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"ericclemmons","id":15182,"avatar_url":"https://avatars.githubusercontent.com/u/15182?v=3","gravatar_id":"","url":"https://api.github.com/users/ericclemmons","html_url":"https://github.com/ericclemmons","followers_url":"https://api.github.com/users/ericclemmons/followers","following_url":"https://api.github.com/users/ericclemmons/following{/other_user}","gists_url":"https://api.github.com/users/ericclemmons/gists{/gist_id}","starred_url":"https://api.github.com/users/ericclemmons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericclemmons/subscriptions","organizations_url":"https://api.github.com/users/ericclemmons/orgs","repos_url":"https://api.github.com/users/ericclemmons/repos","events_url":"https://api.github.com/users/ericclemmons/events{/privacy}","received_events_url":"https://api.github.com/users/ericclemmons/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/ericclemmons/npm-install-loader/milestones/4","html_url":"https://github.com/ericclemmons/npm-install-loader/milestones/2.0.0","labels_url":"https://api.github.com/repos/ericclemmons/npm-install-loader/milestones/4/labels","id":1477769,"number":4,"title":"2.0.0","description":"","creator":{"login":"ericclemmons","id":15182,"avatar_url":"https://avatars.githubusercontent.com/u/15182?v=3","gravatar_id":"","url":"https://api.github.com/users/ericclemmons","html_url":"https://github.com/ericclemmons","followers_url":"https://api.github.com/users/ericclemmons/followers","following_url":"https://api.github.com/users/ericclemmons/following{/other_user}","gists_url":"https://api.github.com/users/ericclemmons/gists{/gist_id}","starred_url":"https://api.github.com/users/ericclemmons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericclemmons/subscriptions","organizations_url":"https://api.github.com/users/ericclemmons/orgs","repos_url":"https://api.github.com/users/ericclemmons/repos","events_url":"https://api.github.com/users/ericclemmons/events{/privacy}","received_events_url":"https://api.github.com/users/ericclemmons/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":3,"state":"open","created_at":"2015-12-30T03:04:45Z","updated_at":"2016-01-23T07:28:20Z","due_on":null,"closed_at":null},"comments":25,"created_at":"2015-12-30T03:20:25Z","updated_at":"2016-01-23T07:46:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ericclemmons/npm-install-loader/pulls/5","html_url":"https://github.com/ericclemmons/npm-install-loader/pull/5","diff_url":"https://github.com/ericclemmons/npm-install-loader/pull/5.diff","patch_url":"https://github.com/ericclemmons/npm-install-loader/pull/5.patch"},"body":"I _just_ found out about a similar project:\r\n> https://github.com/renke/auto-install-webpack-plugin\r\n\r\nFrom what I can gather, this may be a better solution than what this project is doing.\r\n\r\nLet's see if I can work up an overview (please check this @renke!)\r\n\r\n- `npm-install-loader`:\r\n  - Is a `loader`, intended to be used during the processing of a JS file.\r\n  - Because of this, it only has access to the `source`, `map`, and webpack configuration.\r\n  - As such, it actually parses the AST to determine which dependencies need installation.\r\n  - It operates **synchronously** via `child_process.spawnSync` to ensure the thread & build is blocked until installation completes & any other loaders (e.g. `eslint-loader`, `style`, etc.) take over.\r\n  - Unknown how this would affect `.css` files (e.g. `import \"~bootstrap\"`), which was next on the punch list.\r\n  - Plans to support all CLI flags (#3).\r\n  - Because it operates per-file, if there are 10 missing dependencies in that single file, they're all installed at once.\r\n  - How does this contrast with a plugin?\r\n\r\n- `auto-install-webpack-plugin`:\r\n  - Is a `plugin`, which means it has access to the compiler and a great deal more.\r\n  - Hooks directly into the [module][1] resolver, meaning it can do an **async** installation.\r\n  - Looks to hook into _all_ module resolution, including those of stylesheets.\r\n  - Does it block the build?\r\n  - Does it install one dependency at a time?\r\n  - How does this contrast with a loader?\r\n\r\nI'll await feedback, but my initial thoughts are to:\r\n\r\n1. Complete any outstanding issues.\r\n2. Test out & send a PR to `auto-install-webpack-plugin` for similar behavior.\r\n3. Deprecate this project & link users to it instead.\r\n\r\nFrankly, this was to scratch an itch and @renke's project didn't show up in my results, but I'm not a fan of competing for the sake of competing.\r\n\r\n[1]: https://github.com/webpack/docs/wiki/plugins#modulerequest-request-async-waterfall"},"comment":{"url":"https://api.github.com/repos/ericclemmons/npm-install-loader/issues/comments/174157415","html_url":"https://github.com/ericclemmons/npm-install-loader/pull/5#issuecomment-174157415","issue_url":"https://api.github.com/repos/ericclemmons/npm-install-loader/issues/5","id":174157415,"user":{"login":"bebraw","id":166921,"avatar_url":"https://avatars.githubusercontent.com/u/166921?v=3","gravatar_id":"","url":"https://api.github.com/users/bebraw","html_url":"https://github.com/bebraw","followers_url":"https://api.github.com/users/bebraw/followers","following_url":"https://api.github.com/users/bebraw/following{/other_user}","gists_url":"https://api.github.com/users/bebraw/gists{/gist_id}","starred_url":"https://api.github.com/users/bebraw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bebraw/subscriptions","organizations_url":"https://api.github.com/users/bebraw/orgs","repos_url":"https://api.github.com/users/bebraw/repos","events_url":"https://api.github.com/users/bebraw/events{/privacy}","received_events_url":"https://api.github.com/users/bebraw/received_events","type":"User","site_admin":false},"created_at":"2016-01-23T07:46:59Z","updated_at":"2016-01-23T07:46:59Z","body":"@ericclemmons Poke me when you want a bit of PR for this. :+1:"}}