Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

finchy70's avatar

Laravel with Vue.js components in production on Forge/Digital Ocean

I have put a web app into production on Forge but can't seem to disable vue dev tools.

I have tried the following in my app.js file

if (process.env['production']) {
    Vue.config.devtools = false;
    Vue.config.debug = false;
    Vue.config.silent = true;
} else {
    Vue.config.devtools = true;
}

and

if (process.env.MIX_APP_ENV === 'production') {
    Vue.config.devtools = false;
    Vue.config.debug = false;
    Vue.config.silent = true;
} else {
    Vue.config.devtools = true;
    Vue.config.debug = true;
    Vue.config.silent =false;
}

and also just

Vue.config.devtools = false;
Vue.config.debug = false;
Vue.config.silent = true;

I also added MIX_NODE_ENV = production to my .env file in forge.

Am I missing something? Do I need to change the forge deployment script?

Im using Laravel 6.2 and vue.js 2.6.10.

Please help!!

Regards Paul.

0 likes
2 replies
mstrauss's avatar
mstrauss
Best Answer
Level 14

@finchy70

I just run npm run prod before pushing to master on GitHub (I use Forge's automatic deploy feature when changes occur on the master branch) and Vue dev tools are not visible in the production site. I am also using Laravel 6.x and Vue 2.x on sites where this is accomplished.

Make sure you do a hard refresh once this is done before inspecting on your production site.

1 like
finchy70's avatar

Thought I'd already tried this but I followed your advice and it's worked. Thanks.

1 like

Please or to participate in this conversation.