When I run my Vue app, the console shows:
You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See mo
This is how Vue checks wether it is in development mode:
if (process.env.NODE_ENV !== 'production' &&
process.env.NODE_ENV !== 'test' &&
typeof console !== 'undefined'
)
Source: GitHub
Note: I removed the check config.productionTip !== false
from the code, because it is used only to turn off the "production tip" even if Vue is running in in development mode.
Gene Parcellano's answer works great as long as you are using Webpack, but this might be a bit more robust.
Edit:
It would be easy to combine both answers like that:
if (
window.webpackHotUpdate || (
process.env.NODE_ENV !== "production" &&
process.env.NODE_ENV !== "test" &&
typeof console !== "undefined"
)
)