{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/10102","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/10102/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/10102/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/10102/events","html_url":"https://github.com/webpack/webpack/issues/10102","id":535440955,"node_id":"MDU6SXNzdWU1MzU0NDA5NTU=","number":10102,"title":"import from node_modules breaks the code ","user":{"login":"shhlkien","id":23404165,"node_id":"MDQ6VXNlcjIzNDA0MTY1","avatar_url":"https://avatars3.githubusercontent.com/u/23404165?v=4","gravatar_id":"","url":"https://api.github.com/users/shhlkien","html_url":"https://github.com/shhlkien","followers_url":"https://api.github.com/users/shhlkien/followers","following_url":"https://api.github.com/users/shhlkien/following{/other_user}","gists_url":"https://api.github.com/users/shhlkien/gists{/gist_id}","starred_url":"https://api.github.com/users/shhlkien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shhlkien/subscriptions","organizations_url":"https://api.github.com/users/shhlkien/orgs","repos_url":"https://api.github.com/users/shhlkien/repos","events_url":"https://api.github.com/users/shhlkien/events{/privacy}","received_events_url":"https://api.github.com/users/shhlkien/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-12-10T01:48:17Z","updated_at":"2019-12-15T11:35:09Z","closed_at":null,"author_association":"NONE","body":"<!-- Please don't delete this template because we'll close your issue -->\r\n<!-- Before creating an issue please make sure you are using the latest version of webpack. -->\r\n\r\n# Bug report\r\n\r\n<!-- Please ask questions on StackOverflow or the webpack Gitter. -->\r\n<!-- https://stackoverflow.com/questions/ask?tags=webpack -->\r\n<!-- 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?**\r\nWebpack ouput done but code not working\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce.**\r\n**webpack.config.js**\r\n```js\r\nconst path = require('path');\r\n\r\nmodule.exports = {\r\n  mode: 'development',\r\n  entry: {\r\n    index: './src/js/index.js',\r\n  },\r\n  output: {\r\n    filename: 'bundle.js',\r\n    publicPath: '/assets/',\r\n    path: path.resolve('assets')\r\n  },\r\n  module: {\r\n    rules: [\r\n      {\r\n        test: /\\.js$/,\r\n        exclude: /node_modules/,\r\n        use: {\r\n          loader: 'babel-loader',\r\n          options: {\r\n            cacheDirectory: true,\r\n            presets: ['@babel/preset-env']\r\n          }\r\n        }\r\n      },\r\n    ]\r\n  },\r\n  resolve: {\r\n     extensions: ['.js']\r\n  },\r\n};\r\n```\r\n**src/js/index.js**\r\n```js\r\nimport { VERSION } from \"lodash\";\r\nimport $ from \"jquery\";\r\nconsole.log($('body'), VERSION); \r\nconsole.log('does this work?'); // didn't log anything\r\n```\r\n<!-- A great way to do this is to provide your configuration via a GitHub repository -->\r\n<!-- The most helpful is a minimal reproduction with instructions on how to reproduce -->\r\n<!-- Repositories with too many files or large `webpack.config.js` files are not suitable -->\r\n<!-- Please only add small code snippets directly into this issue -->\r\n<!-- https://gist.github.com is a good place for longer code snippets -->\r\n<!-- If your issue is caused by a plugin or loader, please create an issue on the loader/plugin repository instead -->\r\n\r\n**What is the expected behavior?**\r\nCode works as expected.\r\n\r\n<!-- \"It should work\" is not a helpful explanation -->\r\n<!-- Explain exactly how it should behave -->\r\n\r\n**Other relevant information:**\r\nwebpack version:  ^4.35.0\r\nNode.js version: v10.17.0\r\nOperating System: Ubuntu 18.04\r\nAdditional tools:\r\n"},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/565801203","html_url":"https://github.com/webpack/webpack/issues/10102#issuecomment-565801203","issue_url":"https://api.github.com/repos/webpack/webpack/issues/10102","id":565801203,"node_id":"MDEyOklzc3VlQ29tbWVudDU2NTgwMTIwMw==","user":{"login":"shhlkien","id":23404165,"node_id":"MDQ6VXNlcjIzNDA0MTY1","avatar_url":"https://avatars3.githubusercontent.com/u/23404165?v=4","gravatar_id":"","url":"https://api.github.com/users/shhlkien","html_url":"https://github.com/shhlkien","followers_url":"https://api.github.com/users/shhlkien/followers","following_url":"https://api.github.com/users/shhlkien/following{/other_user}","gists_url":"https://api.github.com/users/shhlkien/gists{/gist_id}","starred_url":"https://api.github.com/users/shhlkien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shhlkien/subscriptions","organizations_url":"https://api.github.com/users/shhlkien/orgs","repos_url":"https://api.github.com/users/shhlkien/repos","events_url":"https://api.github.com/users/shhlkien/events{/privacy}","received_events_url":"https://api.github.com/users/shhlkien/received_events","type":"User","site_admin":false},"created_at":"2019-12-15T11:35:09Z","updated_at":"2019-12-15T11:35:09Z","author_association":"NONE","body":"> Please create reproducible test repo\r\n\r\nI created a repo here: [https://github.com/shhlkien/webpack-test](https://github.com/shhlkien/webpack-test)."}}
{"actor":{"display_login":"shhlkien"}}