{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/6690","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/6690/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/6690/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/6690/events","html_url":"https://github.com/webpack/webpack/issues/6690","id":302860720,"number":6690,"title":"`require.context()` is not transformed in `.mjs` files","user":{"login":"sirlancelot","id":71916,"avatar_url":"https://avatars3.githubusercontent.com/u/71916?v=4","gravatar_id":"","url":"https://api.github.com/users/sirlancelot","html_url":"https://github.com/sirlancelot","followers_url":"https://api.github.com/users/sirlancelot/followers","following_url":"https://api.github.com/users/sirlancelot/following{/other_user}","gists_url":"https://api.github.com/users/sirlancelot/gists{/gist_id}","starred_url":"https://api.github.com/users/sirlancelot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirlancelot/subscriptions","organizations_url":"https://api.github.com/users/sirlancelot/orgs","repos_url":"https://api.github.com/users/sirlancelot/repos","events_url":"https://api.github.com/users/sirlancelot/events{/privacy}","received_events_url":"https://api.github.com/users/sirlancelot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-06T20:50:44Z","updated_at":"2018-03-07T05:06:51Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!-- Please don't delete this template or we'll close your issue -->\r\n<!-- Before creating an issue please make sure you are using the latest version of webpack. -->\r\n<!-- Also consider trying the webpack@beta version, maybe it's already fixed. -->\r\n\r\n**Do you want to request a *feature* or report a *bug*?** Bug\r\n\r\n<!-- Please ask questions on StackOverflow or the webpack Gitter (https://gitter.im/webpack/webpack). -->\r\n<!-- Issues which contain questions or support requests will be closed. -->\r\n\r\n**What is the current behavior?** `require.context()` is not transformed\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce.**\r\n\r\n```\r\n// entry.mjs\r\n\r\nconst pages = require.context(\"./pages/\", true, /^\\.\\/.*\\.vue$/, \"lazy\")\r\nconst routes = pages.keys().map((name) => ({\r\n    component: () => pages(name),\r\n    path: \"/\" + name.slice(2, -4)\r\n}))\r\n```\r\n\r\n<!-- A great way to do this is to provide your configuration via a GitHub gist. -->\r\n<!-- Best provide a minimal reproduceable repo -->\r\n<!-- If your issue is caused by a plugin or loader file the issue on the plugin/loader repo -->\r\n\r\n**What is the expected behavior?** `require.context()` is transformed in to a `webpackAsyncContext` module (consistent with the behavior as if this statement were in a `.js` file).\r\n\r\n**If this is a feature request, what is motivation or use case for changing the behavior?** N/A\r\n\r\n**Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.**\r\n\r\n`node v8.9.3`\r\n`webpack v4.1.0`\r\n`@std/esm v0.24.0`\r\n\r\nI'm running Webpack like so: `node -r @std/esm ./node_modules/.bin/webpack [options]` so that I can write the config files using ESModules."},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/371024215","html_url":"https://github.com/webpack/webpack/issues/6690#issuecomment-371024215","issue_url":"https://api.github.com/repos/webpack/webpack/issues/6690","id":371024215,"user":{"login":"sirlancelot","id":71916,"avatar_url":"https://avatars3.githubusercontent.com/u/71916?v=4","gravatar_id":"","url":"https://api.github.com/users/sirlancelot","html_url":"https://github.com/sirlancelot","followers_url":"https://api.github.com/users/sirlancelot/followers","following_url":"https://api.github.com/users/sirlancelot/following{/other_user}","gists_url":"https://api.github.com/users/sirlancelot/gists{/gist_id}","starred_url":"https://api.github.com/users/sirlancelot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirlancelot/subscriptions","organizations_url":"https://api.github.com/users/sirlancelot/orgs","repos_url":"https://api.github.com/users/sirlancelot/repos","events_url":"https://api.github.com/users/sirlancelot/events{/privacy}","received_events_url":"https://api.github.com/users/sirlancelot/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T05:06:51Z","updated_at":"2018-03-07T05:06:51Z","author_association":"CONTRIBUTOR","body":"@jdalton nice, I wasn't aware of that!\r\n\r\nThe main issue still exists though."}}
{"actor":{"display_login":"sirlancelot"}}