{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/8171","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/8171/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/8171/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/8171/events","html_url":"https://github.com/webpack/webpack/issues/8171","id":369103367,"node_id":"MDU6SXNzdWUzNjkxMDMzNjc=","number":8171,"title":"Webpack load \"module\" entry point when using require","user":{"login":"ericmorand","id":125664,"node_id":"MDQ6VXNlcjEyNTY2NA==","avatar_url":"https://avatars0.githubusercontent.com/u/125664?v=4","gravatar_id":"","url":"https://api.github.com/users/ericmorand","html_url":"https://github.com/ericmorand","followers_url":"https://api.github.com/users/ericmorand/followers","following_url":"https://api.github.com/users/ericmorand/following{/other_user}","gists_url":"https://api.github.com/users/ericmorand/gists{/gist_id}","starred_url":"https://api.github.com/users/ericmorand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericmorand/subscriptions","organizations_url":"https://api.github.com/users/ericmorand/orgs","repos_url":"https://api.github.com/users/ericmorand/repos","events_url":"https://api.github.com/users/ericmorand/events{/privacy}","received_events_url":"https://api.github.com/users/ericmorand/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-11T12:44:02Z","updated_at":"2018-10-15T11:13:50Z","closed_at":null,"author_association":"NONE","body":"Consider the following code:\r\n\r\n```\r\nconst parseFunction = require('parse-function');\r\n\r\nconsole.warn(parseFunction());\r\n```\r\n\r\n`parse-function` module will be resolved by Wepack to `dist/index.es.js` instead of `dist/index.js` as hinted by parse-function package.json:\r\n\r\n```\r\n{\r\n    ...,\r\n    \"main\": \"./dist/index.js\",\r\n    \"module\": \"./dist/index.es.js\",\r\n    ...\r\n}\r\n```\r\n\r\nThis will make the bundle unusable since `parseFunction` will not be a function when it is required from `dist/index.es.js` - but `parseFunction.default` is.\r\n\r\n\r\n**Other relevant information:**\r\nwebpack version:  3.6\r\nNode.js version: 10.11.0\r\nOperating System: Unbuntu 17.04\r\n"},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/429809750","html_url":"https://github.com/webpack/webpack/issues/8171#issuecomment-429809750","issue_url":"https://api.github.com/repos/webpack/webpack/issues/8171","id":429809750,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTgwOTc1MA==","user":{"login":"ericmorand","id":125664,"node_id":"MDQ6VXNlcjEyNTY2NA==","avatar_url":"https://avatars0.githubusercontent.com/u/125664?v=4","gravatar_id":"","url":"https://api.github.com/users/ericmorand","html_url":"https://github.com/ericmorand","followers_url":"https://api.github.com/users/ericmorand/followers","following_url":"https://api.github.com/users/ericmorand/following{/other_user}","gists_url":"https://api.github.com/users/ericmorand/gists{/gist_id}","starred_url":"https://api.github.com/users/ericmorand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericmorand/subscriptions","organizations_url":"https://api.github.com/users/ericmorand/orgs","repos_url":"https://api.github.com/users/ericmorand/repos","events_url":"https://api.github.com/users/ericmorand/events{/privacy}","received_events_url":"https://api.github.com/users/ericmorand/received_events","type":"User","site_admin":false},"created_at":"2018-10-15T11:13:50Z","updated_at":"2018-10-15T11:13:50Z","author_association":"NONE","body":"But is it expected that using `require` point WebPack to the `module` entry point? I'm evaluating if I need to open an issue upstream - i.e. parse-function."}}
{"actor":{"display_login":"ericmorand"}}