1in windows :
2
3thats worked for me without any require in webpack.mix
4
5... just add a new variable in env file with this prefix : MIX_
6
7MIX_API_URL=http://laravel:8000
8but need to restart php artisan serve and also restart npm run watch....
9
10 let api_url = process.env.MIX_API_URL;
11 console.log("my env variable:");
12 console.log(api_url);