How can I determine if webpack.config.js
was loaded via webpack
vs webpack-dev-server
?
Update: The environment variable is changed to WEBPACK_SERVE
.
The webpack dev server will now set the WEBPACK_DEV_SERVER
environment variable, allowing for a more robust way to check.
const isDevServer = process.env.WEBPACK_DEV_SERVER;