I think you can use this https://laravel.com/docs/5.7/mix#environment-variables
Like this https://github.com/JeffreyWay/laravel-mix/issues/1155#issuecomment-326623833
So use require('dotenv').config(); in webpack.mix.js file.
Hi,
My dev experience is low, just started with Laracasts as complete beginner in coding. But I have some sysadmin exp. I have a Gitlab Ci/CD pipeline and building assets before deployment.
I want to tell Laravel-Mix to behave differently for local dev and for production.
I want SourceMaps to compile differently depending on ENV.
How can I achieve this?
@MARKOTITEL - I typically do this
if (mix.inProduction()) {
mix.version();
//whatever else
}
Please or to participate in this conversation.