package/env.js in webpacker-6.0.0.pre.2 vs package/env.js in webpacker-6.0.0.rc.1
- old
+ new
@@ -14,11 +14,17 @@
const config = safeLoad(readFileSync(configPath), 'utf8')
const availableEnvironments = Object.keys(config).join('|')
const regex = new RegExp(`^(${availableEnvironments})$`, 'g')
+// v4 of webpack-dev-server will switch to WEBPACK_DEV_SERVE
+// https://github.com/rails/webpacker/issues/3057
+const runningWebpackDevServer = process.env.WEBPACK_DEV_SERVER === 'true' ||
+ process.env.WEBPACK_DEV_SERVE === 'true'
+
module.exports = {
railsEnv: railsEnv && railsEnv.match(regex) ? railsEnv : DEFAULT,
nodeEnv,
isProduction,
- isDevelopment
+ isDevelopment,
+ runningWebpackDevServer
}