Compiled js runs client side and has no access to either files on server or client (expect for upload on client side and ajax on server side). Anything else would be a security risk
laravel mix environment variables - workflow?
I can't seem to get a clear picture of how this is supposed to work.
i want to compile my JS on 1 machine.. commit it to git and deploy it to an environment. We deploy to test, staging and production via envoyer.
But i want to use the .env to set the environment details for the pusher implementation. i can only get laravel mix to compile the environment variables down at compile time. So they are actually hardcoded in the app.js.
is the idea behind mix to compile at deployment time?
my ideal setup would be to compile it all once and getting the environment variables at runtime.
if there is no way, i will have to expose the data via a variable via html and then pick it up in js. But that seems to me like a nasty workaround.
am i missing something?
ps.. dotenv, tried.. still compiles variables down also testen on clean laravel install.
Please or to participate in this conversation.