Need help disabling the Vue Devtools in production by checking the value of the APP_ENV variable within app.js.
Here's what has been attempted:
Inside webpack.mix.js
require('dotenv').config();
Inside app.js
console.log(process.env.APP_ENV)//Undefined
if (process.env.APP_ENV === 'production') {
Vue.config.devtools = false;
Vue.config.debug = false;
Vue.config.silent = true;
}
Environment Variable
APP_ENV=production
Documentation was consulted regarding adding MIX_APP_ENV to inject variables into webpack, but no solution was found.
Folder Structure:
d----- 01-Feb-21 10:31 PM app
d----- 29-Jan-21 12:12 PM bootstrap
d----- 29-Jan-21 12:12 PM config
d----- 30-Jan-21 10:26 PM database
d----- 16-Apr-21 10:49 PM node_modules
d----- 29-Jan-21 1:14 PM public
d----- 29-Jan-21 12:22 PM resources
d----- 29-Jan-21 12:12 PM routes
d----- 29-Jan-21 12:12 PM storage
d----- 29-Jan-21 12:12 PM tests
d----- 01-Feb-21 9:29 PM vendor
-a---- 29-Jan-21 12:12 PM 220 .editorconfig
-a---- 16-Apr-21 10:45 PM 954 .env
-a---- 29-Jan-21 12:14 PM 816 .env.example
-a---- 29-Jan-21 12:12 PM 111 .gitattributes
-a---- 29-Jan-21 12:12 PM 191 .gitignore
-a---- 29-Jan-21 12:12 PM 181 .styleci.yml
-a---- 29-Jan-21 12:12 PM 1686 artisan
-a---- 01-Feb-21 10:41 PM 1793 composer.json
-a---- 01-Feb-21 10:41 PM 282388 composer.lock
-a---- 16-Apr-21 10:49 PM 531190 package-lock.json
-a---- 16-Apr-21 10:49 PM 1103 package.json
-a---- 29-Jan-21 12:12 PM 1202 phpunit.xml
-a---- 29-Jan-21 12:12 PM 3780 README.md
-a---- 29-Jan-21 12:12 PM 563 server.php
-a---- 16-Apr-21 10:55 PM 578 webpack.mix.js