{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/5013","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/5013/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/5013/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/5013/events","html_url":"https://github.com/eslint/eslint/issues/5013","id":127713414,"number":5013,"title":"Bundle production dependencies","user":{"login":"gajus","id":973543,"avatar_url":"https://avatars.githubusercontent.com/u/973543?v=3","gravatar_id":"","url":"https://api.github.com/users/gajus","html_url":"https://github.com/gajus","followers_url":"https://api.github.com/users/gajus/followers","following_url":"https://api.github.com/users/gajus/following{/other_user}","gists_url":"https://api.github.com/users/gajus/gists{/gist_id}","starred_url":"https://api.github.com/users/gajus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gajus/subscriptions","organizations_url":"https://api.github.com/users/gajus/orgs","repos_url":"https://api.github.com/users/gajus/repos","events_url":"https://api.github.com/users/gajus/events{/privacy}","received_events_url":"https://api.github.com/users/gajus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/build","name":"build","color":"fad8c7"},{"url":"https://api.github.com/repos/eslint/eslint/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/eslint/eslint/labels/proposal","name":"proposal","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-20T15:55:48Z","updated_at":"2016-02-09T02:47:30Z","closed_at":null,"body":"ESLint is used only in development environment. It is a popular tool with well maintained tests suit. As such, I think it would benefit from using NPM [`bundledDependencies`](https://docs.npmjs.com/files/package.json#bundleddependencies) `package.json` property. Specifically, this would make the install time of ESLint a lot faster and would lift restrictions of the modularisation.\r\n\r\nThe build process can be [automated to include all production dependencies](https://github.com/gajus/bundle-dependencies#deprecated). A simple NPM script can be used to streamline the process:\r\n\r\n```json\r\n{\r\n    \"bundle-dependencies\": \"bundled-dependencies\",\r\n    \"bundle-prepare\": \"npm run bundle-dependencies; git commit -m 'Updated bundle dependencies.' ./package.json; rm -fr ./node_modules; npm install --production; npm publish; npm install;\"\r\n}\r\n```\r\n\r\nAn example of a package using `bundledDependecies` is [`canonical`](https://github.com/gajus/canonical). To experience the benefits, try to install canonical version that is using `bundledDependecies` (3.0.0+) and compare it against a version that is not using it (2.5.0). Here are the test results on my machine:\r\n\r\n```sh\r\nnpm install canonical@3.0.1\r\n\r\n10.81s user\r\n4.45s system\r\n110% cpu\r\n13.790 total\r\n```\r\n\r\n```sh\r\nnpm install canonical@2.5.0\r\n\r\n13.17s user\r\n2.77s system\r\n27% cpu\r\n58.136 total\r\n```\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/30050273-bundle-production-dependencies?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/181677505","html_url":"https://github.com/eslint/eslint/issues/5013#issuecomment-181677505","issue_url":"https://api.github.com/repos/eslint/eslint/issues/5013","id":181677505,"user":{"login":"lo1tuma","id":169170,"avatar_url":"https://avatars.githubusercontent.com/u/169170?v=3","gravatar_id":"","url":"https://api.github.com/users/lo1tuma","html_url":"https://github.com/lo1tuma","followers_url":"https://api.github.com/users/lo1tuma/followers","following_url":"https://api.github.com/users/lo1tuma/following{/other_user}","gists_url":"https://api.github.com/users/lo1tuma/gists{/gist_id}","starred_url":"https://api.github.com/users/lo1tuma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lo1tuma/subscriptions","organizations_url":"https://api.github.com/users/lo1tuma/orgs","repos_url":"https://api.github.com/users/lo1tuma/repos","events_url":"https://api.github.com/users/lo1tuma/events{/privacy}","received_events_url":"https://api.github.com/users/lo1tuma/received_events","type":"User","site_admin":false},"created_at":"2016-02-09T02:47:30Z","updated_at":"2016-02-09T02:47:30Z","body":"I think the benchmark is a little bit unrealistic. Normally you would install eslint in a project which has a lot of other dependencies and the possibility is quite high that the project has some modules in common with eslint (I guess glob or lodash is in almost every dependency tree).\r\n\r\nI’ve measured the time installing `eslint-bundled` in an existing project and it turns out that it takes longer than installing the non-bundled version.\r\n\r\n```\r\n$ cd existing-project/\r\n$ npm cache clean\r\n$ time npm i eslint@v2.0.0-rc.0\r\nnpm i eslint@v2.0.0-rc.0  11.49s user 1.05s system 72% cpu 17.269 total\r\n$ npm cache clean\r\n$ time npm i eslint-bundled@v2.0.0-rc.0\r\nnpm i eslint-bundled@v2.0.0-rc.0  16.74s user 3.31s system 89% cpu 22.446 total\r\n```"}}