{"action":"closed","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/6837","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/6837/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/6837/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/6837/events","html_url":"https://github.com/webpack/webpack/issues/6837","id":307742767,"number":6837,"title":"function constructor name changed after bundled as a library","user":{"login":"zhenyulin","id":3323196,"avatar_url":"https://avatars0.githubusercontent.com/u/3323196?v=4","gravatar_id":"","url":"https://api.github.com/users/zhenyulin","html_url":"https://github.com/zhenyulin","followers_url":"https://api.github.com/users/zhenyulin/followers","following_url":"https://api.github.com/users/zhenyulin/following{/other_user}","gists_url":"https://api.github.com/users/zhenyulin/gists{/gist_id}","starred_url":"https://api.github.com/users/zhenyulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhenyulin/subscriptions","organizations_url":"https://api.github.com/users/zhenyulin/orgs","repos_url":"https://api.github.com/users/zhenyulin/repos","events_url":"https://api.github.com/users/zhenyulin/events{/privacy}","received_events_url":"https://api.github.com/users/zhenyulin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-22T17:29:01Z","updated_at":"2018-03-22T18:02:32Z","closed_at":"2018-03-22T18:02:32Z","author_association":"NONE","body":"my webpack.config.js\r\n```js\r\nmodule.exports = {\r\n\tmode: 'production',\r\n\tdevtool: 'source-map',\r\n\ttarget: 'node',\r\n\tentry: './src/index',\r\n\toutput: {\r\n\t\tlibraryTarget: 'umd',\r\n\t\tpath: path.resolve('./dist'),\r\n\t\tfilename: 'index.js',\r\n\t},\r\n\texternals: nodeExternals(),\r\n\tmodule: {\r\n\t\trules: [\r\n\t\t\t{\r\n\t\t\t\ttest: /\\.js?$/,\r\n\t\t\t\tuse: 'babel-loader',\r\n\t\t\t\texclude: '/node_modules/',\r\n\t\t\t},\r\n\t\t],\r\n\t},\r\n};\r\n```\r\n\r\ncreator.js\r\n```js\r\nexport function NError(fields) {\r\n\tif (!(this instanceof NError)) {\r\n\t\treturn new NError(fields);\r\n\t}\r\n\tObject.keys(fields).forEach(key => {\r\n\t\tthis[key] = fields[key];\r\n\t});\r\n\tError.captureStackTrace(this, NError);\r\n\treturn this;\r\n}\r\n```\r\n\r\ntest result in jest\r\n```js\r\n     - Snapshot\r\n    + Received\r\n\r\n    - NError {\r\n    + a {\r\n        \"category\": \"FETCH_NETWORK_ERROR\",\r\n        \"code\": \"MOCKED_FETCH_NETWORK_ERROR_CODE\",\r\n        \"message\": \"mocked fetch network error\",\r\n      }\r\n```\r\n\r\nhere the constructor name `NError` has changed to `a`"}}
{"actor":{"display_login":"montogeek"}}