I try to build an Angular 5 application with the standard ng build --prod
command, and I want to set the basic API-Url in the environment.prod.ts
to a value dependent on my process.env
variables.
This is my file:
export const environment = {
production: true,
apiUrl: `${process.env.BASE_URL}` || 'http://localhost:8070/',
};
But when I try to build the application the following error occurs:
ERROR in src/environments/environment.ts(7,16): error TS2304: Cannot find name 'process'.
How can I set my API-Url according to an env variable when building the application?