{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/514","labels_url":"https://api.github.com/repos/webpack/webpack/issues/514/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/514/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/514/events","html_url":"https://github.com/webpack/webpack/issues/514","id":45151936,"number":514,"title":"Error by default on dynamic requires","user":{"login":"fresheneesz","id":149531,"avatar_url":"https://avatars.githubusercontent.com/u/149531?v=3","gravatar_id":"","url":"https://api.github.com/users/fresheneesz","html_url":"https://github.com/fresheneesz","followers_url":"https://api.github.com/users/fresheneesz/followers","following_url":"https://api.github.com/users/fresheneesz/following{/other_user}","gists_url":"https://api.github.com/users/fresheneesz/gists{/gist_id}","starred_url":"https://api.github.com/users/fresheneesz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fresheneesz/subscriptions","organizations_url":"https://api.github.com/users/fresheneesz/orgs","repos_url":"https://api.github.com/users/fresheneesz/repos","events_url":"https://api.github.com/users/fresheneesz/events{/privacy}","received_events_url":"https://api.github.com/users/fresheneesz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/webpack/webpack/labels/enhancement","name":"enhancement","color":"DDDDDD"},{"url":"https://api.github.com/repos/webpack/webpack/labels/webpack-2","name":"webpack-2","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-10-07T19:30:27Z","updated_at":"2015-07-26T01:13:22Z","closed_at":null,"body":"Webpack should error on dynamic requires unless the user gives a specific list (in the options) of files that dynamic requires should pick from. I wasted a good 2 days trying to figure out why my bundle builder was having memory issues, just to find out webpack was trying to shove my entire backend into the frontend bundle.\r\n\r\n@jhnns \r\nhttps://github.com/webpack/webpack/issues/496"},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/124924700","html_url":"https://github.com/webpack/webpack/issues/514#issuecomment-124924700","issue_url":"https://api.github.com/repos/webpack/webpack/issues/514","id":124924700,"user":{"login":"fresheneesz","id":149531,"avatar_url":"https://avatars.githubusercontent.com/u/149531?v=3","gravatar_id":"","url":"https://api.github.com/users/fresheneesz","html_url":"https://github.com/fresheneesz","followers_url":"https://api.github.com/users/fresheneesz/followers","following_url":"https://api.github.com/users/fresheneesz/following{/other_user}","gists_url":"https://api.github.com/users/fresheneesz/gists{/gist_id}","starred_url":"https://api.github.com/users/fresheneesz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fresheneesz/subscriptions","organizations_url":"https://api.github.com/users/fresheneesz/orgs","repos_url":"https://api.github.com/users/fresheneesz/repos","events_url":"https://api.github.com/users/fresheneesz/events{/privacy}","received_events_url":"https://api.github.com/users/fresheneesz/received_events","type":"User","site_admin":false},"created_at":"2015-07-26T01:13:22Z","updated_at":"2015-07-26T01:13:22Z","body":"Also I just noticed that the info at the link you gave me doesn't actually help disable dynamic requires. I added the following to my config:\r\n\r\n```\r\nmodule: {\r\n    // Disable handling of unknown requires\r\n    unknownContextRegExp: /$^/,\r\n    unknownContextCritical: false,\r\n\r\n    // Disable handling of requires with a single expression\r\n    exprContextRegExp: /$^/,\r\n    exprContextCritical: false,\r\n\r\n    // Warn for every expression in require\r\n    wrappedContextCritical: true\r\n  }\r\n```\r\n\r\nBut I'm still seeing `moment.js`'s external languages in my bundle."}}