Skip to content

Commit

Permalink
[RAV] Bring environment variable support to config generation (part 2…
Browse files Browse the repository at this point in the history
…): fix Angular config generation and add polyfill for process.env support
  • Loading branch information
ambrauer committed Jan 20, 2022
1 parent 714c336 commit dcacacc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function generateConfig(configOverrides?: { [key: string]: unknown }, out
let configText = `/* eslint-disable */
// Do not edit this file, it is auto-generated at build time!
// See scripts/bootstrap.ts to modify the generation of this file.
const config = {};\n`;
const config: { [key: string]: string } = {};\n`;

// Set base configuration values, allowing override with environment variables
Object.keys(config).forEach((prop) => {
Expand All @@ -57,7 +57,7 @@ const config = {};\n`;
computedConfig[prop]
};\n`;
});
configText += `module.exports = config;`;
configText += `export const environment = config;`;

const configPath = path.resolve(outputPath);
console.log(`Writing runtime config to ${configPath}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ import 'core-js/es/reflect';
**/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.

/** Polyfill for node.js process **/
(window as any).process = { env: { DEBUG: undefined }, };



/***************************************************************************************************
Expand Down

0 comments on commit dcacacc

Please sign in to comment.