{"action":"closed","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/6975","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/6975/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/6975/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/6975/events","html_url":"https://github.com/webpack/webpack/issues/6975","id":312019897,"number":6975,"title":"process.env.PORT is undefined in CI Build","user":{"login":"jeliasson","id":865493,"avatar_url":"https://avatars2.githubusercontent.com/u/865493?v=4","gravatar_id":"","url":"https://api.github.com/users/jeliasson","html_url":"https://github.com/jeliasson","followers_url":"https://api.github.com/users/jeliasson/followers","following_url":"https://api.github.com/users/jeliasson/following{/other_user}","gists_url":"https://api.github.com/users/jeliasson/gists{/gist_id}","starred_url":"https://api.github.com/users/jeliasson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeliasson/subscriptions","organizations_url":"https://api.github.com/users/jeliasson/orgs","repos_url":"https://api.github.com/users/jeliasson/repos","events_url":"https://api.github.com/users/jeliasson/events{/privacy}","received_events_url":"https://api.github.com/users/jeliasson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-04-06T15:29:51Z","updated_at":"2018-04-12T08:42:07Z","closed_at":"2018-04-12T08:42:07Z","author_association":"NONE","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\nI'm in the process of deploying a webpack-supported node.js app to Azure App Service, but I have a problem using ```process.env.PORT``` in the source code. This environment variable is not available during CI Build, and when webpack compiles it becomes ```undefined```. \r\n\r\nAn example:\r\n```const NODE_PORT = process.env.PORT || 3000;``` will become ```var NODE_PORT = undefined || 3000;```. \r\n\r\n```process.env.PORT``` is defined at runtime (as a namepipe) and is dynamic, and therefore can't be defined (from what I know) in e.g. ```webpack --env.PORT=\\\\.\\2sf12g3[...]```.\r\nAny suggestion on how I can approach this? Can I tell webpack to not compile/parse specific lines?\r\n\r\nThanks! \r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\nBug\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?**\r\n`process.env.PORT` becomes `undefined`\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce.**\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?**\r\n`process.env.PORT` to be in the compiled version, literally. \r\n\r\n**If this is a feature request, what is motivation or use case for changing the behavior?**\r\n\r\n**Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.**\r\nNode: 8.10.0\r\nWebpack: 4.5.0\r\nOS: Windows 10, Windows Server 2016"}}
{"actor":{"display_login":"jeliasson"}}