Skip to content

Instantly share code, notes, and snippets.

@nivrith
Created October 2, 2020 23:44
Show Gist options
  • Select an option

  • Save nivrith/70137c4969420a728582d5786a1f38e6 to your computer and use it in GitHub Desktop.

Select an option

Save nivrith/70137c4969420a728582d5786a1f38e6 to your computer and use it in GitHub Desktop.
Webpack Config for Commandline Variables for Angular
import { CustomWebpackBrowserSchema, TargetOptions } from '@angular-builders/custom-webpack';
import * as webpack from 'webpack';
export default (
config: webpack.Configuration,
options: CustomWebpackBrowserSchema,
targetOptions: TargetOptions
) => {
config.plugins.push(
new webpack.DefinePlugin({
APP_ENV: process.env.APP_ENV,
})
);
return config;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment