diff --git a/package.json b/package.json
index 5f8651d430e00bfbed4dad9ec1770004007d1c4e..048717a822967270dac855e5aec2a568a1d670f5 100644
--- a/package.json
+++ b/package.json
@@ -14,8 +14,8 @@
   },
   "scripts": {
     "postinstall": "node ./scripts/postinstall.js",
-    "start": "cross-env NODE_ENV=development webpack-dev-server",
-    "build": "rimraf ./public && cross-env NODE_ENV=production webpack --mode=production",
+    "start": "webpack-dev-server --mode=development",
+    "build": "rimraf ./public && webpack --mode=production",
     "doc": "node ./scripts/doc/build.js",
     "prettier": "prettier --write '*.js' 'src/**/*.js'",
     "lint:js": "eslint '*.js' 'scripts/**/*.js' 'src/**/*.js'",
@@ -67,7 +67,6 @@
     "babel-preset-env": "^1.6.1",
     "babel-preset-react": "^6.24.1",
     "copy-webpack-plugin": "^4.5.1",
-    "cross-env": "^5.1.3",
     "css-loader": "^1.0.0",
     "dotenv": "^5.0.1",
     "eslint": "^5.2.0",
diff --git a/webpack.config.js b/webpack.config.js
index d799bd2df1504853baf61658bceb10dd7c9811d4..b4de849de503cee902cdc366972cc0a519d2f05e 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -12,10 +12,6 @@ const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
 const _ = require("lodash");
 
 function createHTTPSConfig() {
-  if (process.env.NODE_ENV === "production") {
-    return false;
-  }
-
   // Generate certs for the local webpack-dev-server.
   if (fs.existsSync(path.join(__dirname, "certs"))) {
     const key = fs.readFileSync(path.join(__dirname, "certs", "key.pem"));
@@ -77,7 +73,7 @@ class LodashTemplatePlugin {
   }
 }
 
-const config = {
+module.exports = (env, argv) => ({
   entry: {
     index: path.join(__dirname, "src", "index.js"),
     hub: path.join(__dirname, "src", "hub.js"),
@@ -89,8 +85,7 @@ const config = {
     filename: "assets/js/[name]-[chunkhash].js",
     publicPath: process.env.BASE_ASSETS_PATH || ""
   },
-  mode: "development",
-  devtool: process.env.NODE_ENV === "production" ? "source-map" : "inline-source-map",
+  devtool: argv.mode === "production" ? "source-map" : "inline-source-map",
   devServer: {
     open: false,
     https: createHTTPSConfig(),
@@ -249,7 +244,7 @@ const config = {
     // Extract required css and add a content hash.
     new ExtractTextPlugin({
       filename: "assets/stylesheets/[name]-[md5:contenthash:hex:20].css",
-      disable: process.env.NODE_ENV !== "production"
+      disable: argv.mode !== "production"
     }),
     // Transform the output of the html-loader using _.template
     // before passing the result to html-webpack-plugin
@@ -257,7 +252,7 @@ const config = {
       // expose these variables to the lodash template
       // ex: <%= ORIGIN_TRIAL_TOKEN %>
       imports: {
-        NODE_ENV: process.env.NODE_ENV,
+        NODE_ENV: argv.mode,
         ORIGIN_TRIAL_EXPIRES: process.env.ORIGIN_TRIAL_EXPIRES,
         ORIGIN_TRIAL_TOKEN: process.env.ORIGIN_TRIAL_TOKEN
       }
@@ -265,7 +260,7 @@ const config = {
     // Define process.env variables in the browser context.
     new webpack.DefinePlugin({
       "process.env": JSON.stringify({
-        NODE_ENV: process.env.NODE_ENV,
+        NODE_ENV: argv.mode,
         JANUS_SERVER: process.env.JANUS_SERVER,
         DEV_RETICULUM_SERVER: process.env.DEV_RETICULUM_SERVER,
         ASSET_BUNDLE_SERVER: process.env.ASSET_BUNDLE_SERVER,
@@ -273,6 +268,4 @@ const config = {
       })
     })
   ]
-};
-
-module.exports = config;
+});
diff --git a/yarn.lock b/yarn.lock
index 9d6efd300b78e5a6ec1a46f38e3dcc2dd0597d71..e22104c37eaa154789ef885d60f4ec0a8b7a2d77 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2060,13 +2060,6 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
     safe-buffer "^5.0.1"
     sha.js "^2.4.8"
 
-cross-env@^5.1.3:
-  version "5.2.0"
-  resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
-  dependencies:
-    cross-spawn "^6.0.5"
-    is-windows "^1.0.0"
-
 cross-spawn@^3.0.0:
   version "3.0.1"
   resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982"
@@ -4202,7 +4195,7 @@ is-utf8@^0.2.0:
   version "0.2.1"
   resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
 
-is-windows@^1.0.0, is-windows@^1.0.1, is-windows@^1.0.2:
+is-windows@^1.0.1, is-windows@^1.0.2:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"