I would like to configure my Webpack build such that I can declare import { environment } from './environments/environment' in my Angular 2 components and have the import load environment.ts during development, but environment.prod.ts in production. How would I tell Webpack to replace the import during a build?
I'm looking for something very similar to the way projects created with Angular CLI are handling environment configurations. Unfortunately, I'd rather not use the CLI yet as it is still in beta, and I also haven't wrapped my head around how the project works and how to extend its build pipe.
I also want to avoid scattering conditional statements throughout my source code, so no using process.env.NODE_ENV in an if-statement everywhere that I want to import the environment file.
environment.prod.tsduring the build withng build --env=prod- AngularChef