Skip to content

Commit

Permalink
[Angular] Adjust config generation messages order
Browse files Browse the repository at this point in the history
  • Loading branch information
illiakovalenko committed Aug 13, 2024
1 parent d8a1d8d commit 0bd0eba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ const defaultConfigValue: JssConfig = {
defaultServerRoute: '/',
};

generateConfig('src/environments/environment.js', defaultConfigValue, { production: false });
generateConfig('src/environments/environment.prod.js', defaultConfigValue, { production: true });
async function main() {
await generateConfig('src/environments/environment.js', defaultConfigValue, {
production: false,
});
await generateConfig('src/environments/environment.prod.js', defaultConfigValue, {
production: true,
});
}

main();

/**
* Generates the JSS config based on config plugins (under ./config/plugins)
Expand All @@ -47,7 +55,7 @@ export function generateConfig(
};
}, {});

jssConfigFactory
return jssConfigFactory
.create(defaultConfig)
.then((config) => {
writeConfig(Object.assign(config, configOverrides), outputPath);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as fs from 'fs';
import { generateConfig } from './generate-config';
import clientFactory from 'lib/graphql-client-factory';
import { getGraphQLClientFactoryConfig } from 'lib/graphql-client-factory/config';

Expand All @@ -10,7 +9,7 @@ import { getGraphQLClientFactoryConfig } from 'lib/graphql-client-factory/config
//
// The `jss graphql:update` command should be executed when Sitecore templates related to the site are altered.

generateConfig('src/environments/environment.js');
import './generate-config';

const clientFactoryConfig = getGraphQLClientFactoryConfig();

Expand Down

0 comments on commit 0bd0eba

Please sign in to comment.