{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/839","labels_url":"https://api.github.com/repos/webpack/webpack/issues/839/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/839/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/839/events","html_url":"https://github.com/webpack/webpack/issues/839","id":59442197,"number":839,"title":"ignoring node_modules","user":{"login":"jlongster","id":17031,"avatar_url":"https://avatars.githubusercontent.com/u/17031?v=3","gravatar_id":"","url":"https://api.github.com/users/jlongster","html_url":"https://github.com/jlongster","followers_url":"https://api.github.com/users/jlongster/followers","following_url":"https://api.github.com/users/jlongster/following{/other_user}","gists_url":"https://api.github.com/users/jlongster/gists{/gist_id}","starred_url":"https://api.github.com/users/jlongster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlongster/subscriptions","organizations_url":"https://api.github.com/users/jlongster/orgs","repos_url":"https://api.github.com/users/jlongster/repos","events_url":"https://api.github.com/users/jlongster/events{/privacy}","received_events_url":"https://api.github.com/users/jlongster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-02T06:06:26Z","updated_at":"2015-03-02T15:29:20Z","closed_at":null,"body":"I'm sure this has been talked about before, but I can't find a clear issue for it. I'm playing around with using webpack with server-side node modules (using `target: node`). I started to like the idea of bundling of everything into a single js file because that would be cool for deployment, but what kills that idea is binary dependencies. They definitely can't be bundled in, though you might know of a hack that lets me alias them or something.\r\n\r\nIs there any way to tell the system ignore bundling anything coming from `node_modules`, and just leave it as a `require` statement?\r\n\r\nI don't know if the `IgnorePlugin` means that, but if so, trying it results in an error: `plugins: [ new webpack.IgnorePlugin(/.*/, /.*node_modules.*/) ]`\r\n\r\n```\r\n% webpack --config webpack.node.config.js\r\n\r\n/Users/james/projects/jlongster4/node_modules/webpack/lib/Compilation.js:203\r\n                factory.create(module.context, dependencies[0], function(err, dependantModul\r\n                                     ^\r\nTypeError: Cannot read property 'context' of null\r\n    at Tapable.<anonymous> (/Users/james/projects/jlongster4/node_modules/webpack/lib/Compilation.js:203:24)\r\n```"},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/76731839","html_url":"https://github.com/webpack/webpack/issues/839#issuecomment-76731839","issue_url":"https://api.github.com/repos/webpack/webpack/issues/839","id":76731839,"user":{"login":"jlongster","id":17031,"avatar_url":"https://avatars.githubusercontent.com/u/17031?v=3","gravatar_id":"","url":"https://api.github.com/users/jlongster","html_url":"https://github.com/jlongster","followers_url":"https://api.github.com/users/jlongster/followers","following_url":"https://api.github.com/users/jlongster/following{/other_user}","gists_url":"https://api.github.com/users/jlongster/gists{/gist_id}","starred_url":"https://api.github.com/users/jlongster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlongster/subscriptions","organizations_url":"https://api.github.com/users/jlongster/orgs","repos_url":"https://api.github.com/users/jlongster/repos","events_url":"https://api.github.com/users/jlongster/events{/privacy}","received_events_url":"https://api.github.com/users/jlongster/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T15:29:20Z","updated_at":"2015-03-02T15:29:20Z","body":"I suppose this works:\r\n\r\n```js\r\n  externals: [\r\n    function(context, request, cb) {\r\n      if(/^[a-z\\-0-9]+$/.test(request)) {\r\n        cb(null, 'commonjs ' + request);\r\n        return;\r\n      }\r\n      cb();\r\n    }\r\n  ]\r\n```\r\n\r\nI haven't fully tested it though... I'd be surprised if nobody has tried this before?"}}