You are correct about the fact that all front-end code is always visible to the end user.
I think the recommended method the author is referring to is a .env like file (npmjs.com/package/dotenv). Which does not hide the values but makes them more variable and easier to change without having to alter your code.
You might want your front-end connecting to different base URL's depending on what environment it is running (dev, staging, prod).
You are correct about the fact that all front-end code is always visible to the end user.
I think the recommended method the author is referring to is a .env like file (npmjs.com/package/dotenv). Which does not hide the values but makes them more variable and easier to change without having to alter your code.
You might want your front-end connecting to different base URL's depending on what environment it is running (dev, staging, prod).
Thanks for the response. Your points make sense.
Exact, the base url of the API is not a sensitive information. You can track all API calls with your browser devtools anyway