title: Why is Environment not being set in Webpack
body: <p>I have webpack 4.17.1 working with my SPA in the Dev environment.</p>
  
  <p>Now I want to package for Production.</p>
  
  <p>It is started with this command in the Visual Studio Task Runner:</p>
  
  <pre><code> C:\Dev\Traken.app\Traken.5\Dev\Traken\Traken&gt; cmd /c SET NODE_ENV=production&amp;&amp; webpack --color
  </code></pre>
  
  <p>However, it appears the Environment is not being picked up by WebPack, as this command returns <code>undefined</code></p>
  
  <pre><code>console.log("mode=", argv.mode);
  </code></pre>
  
  <p>This is webpack.config.js:</p>
  
  <pre><code>const path = require("path");
  const webpack = require("webpack");
  const { AureliaPlugin, ModuleDependenciesPlugin, GlobDependenciesPlugin } = require("aurelia-webpack-plugin");
  const ExtractTextPlugin = require("extract-text-webpack-plugin");
  
  const extractCSS = new ExtractTextPlugin("vendor.css");
  const bundleOutputDir = "./wwwroot/dist";
  
  module.exports = (env, argv) =&gt; {
      if ((!argv || !argv.mode) &amp;&amp; process.env.ASPNETCORE_ENVIRONMENT === "Development") {
          argv = { mode: "development" };
      }
      console.log("mode=", argv.mode);
      const isDevBuild = argv.mode !== "production";
      const cssLoader = { loader: isDevBuild ? "css-loader" : "css-loader?minimize" };
      return [{
          target: "web",
          mode: isDevBuild ? "development" : "production",
          entry: { "app": ["es6-promise/auto", "aurelia-bootstrapper"] },
          resolve: {
              extensions: [".ts", ".js"],
              modules: ["ClientApp", "node_modules"],
          },
          output: {
              path: path.resolve(bundleOutputDir),
              publicPath: "/dist/",
              filename: "[name].js",
              chunkFilename: "[name].js"
          },
          module: {
  
              rules: [
                  { test: /\.ts$/i, include: [/ClientApp/, /node_modules/], use: "awesome-typescript-loader" },
                  { test: /\.html$/i, use: 'html-loader' },
                  { test: /\.css$/i, use: isDevBuild ? 'css-loader' : 'css-loader?minimize' },
                  { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' },
                  { test: /\.woff2(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader', query: { limit: 10000, mimetype: 'application/font-woff2' } },
                  { test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader', query: { limit: 10000, mimetype: 'application/font-woff' } },
                  { test: /\.(ttf|eot|svg|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' },
                  { test: /\.(cur|ani)$/, loader: 'file-loader' }
  ]
  
  
  
          },
          optimization: {
              splitChunks: {
                  cacheGroups: {
                      commons: {
                          test: /[\\/]node_modules[\\/]/,
                          name: "vendor",
                          chunks: "all"
                      }
                  }
              }
          },
          devtool: isDevBuild ? "source-map" : false,
          performance: {
              hints: false
          },
          plugins: [
              new webpack.ProvidePlugin({
                  'Promise': 'bluebird'
              }),
              new ModuleDependenciesPlugin({
                  "aurelia-orm": [
                      "./component/association-select",
                      "./component/view/bootstrap/association-select.html",
                      "./component/view/bootstrap/paged.html",
                      "./component/paged"],
                  "aurelia-authentication": ["./authFilterValueConverter"]
              }),
              new webpack.DefinePlugin({ IS_DEV_BUILD: JSON.stringify(isDevBuild) }),
              new AureliaPlugin({ aureliaApp: "boot" }),
              new GlobDependenciesPlugin({ "boot": ["ClientApp/**/*.{ts,html}"] }),
              new ModuleDependenciesPlugin({}),
              extractCSS
          ]
      }];
  };
  </code></pre>