How to Determine the ASP.NET Core Environment in my Gulpfile.js
I am using ASP.NET Core MVC 6 using Visual Studio 2015. In my gulpfile.js script I want to know if the hosting environment is Development, Staging or Production so that I can add or remove source maps (.map files) and do other things. Is this possible? UPDATE Relevant issue on GitHub . You can use the ASPNETCORE_ENVIRONMENT (Was formerly ASPNET_ENV in RC1) environment variable to get the environment. This can be done in your gulpfile using process.env.ASPNETCORE_ENVIRONMENT . If the environment variable does not exist, you can fallback to reading the launchSettings.json file which Visual