Since Vue.js is comes already installed in Laravel, I'm not sure how to set it to production mode.
When I launch my website I get the message in console:
You are running Vue in development mode. Make sure to turn on production mode when deploying for production.
Just build your assets using “npm run production”
Method 1
npm run production
Method 2 In Laravel, add an environment variable in laravel configuration and based on the load the Vue configurations in the run time.
Define: MIX_ENV_MODE=production
Usage: process.env.MIX_ENV_MODE
And finally, add this code in any of your configuration script files
if (process.env.MIX_ENV_MODE === 'production') {
Vue.config.devtools = false;
Vue.config.debug = false;
Vue.config.silent = true;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With