Skip to content

Commit

Permalink
chore(core): try to avoid using top level await
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed May 20, 2024
1 parent 428657a commit d378e34
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/core/src/app/prepare/prepareClientConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ export const prepareClientConfigs = async (app: App): Promise<void> => {

// generate client config files entry
const content = `\
export const clientConfigs = (await Promise.all([
${clientConfigFiles.map((filePath) => ` import('${filePath}'),`).join('\n')}
])).map((m) => m.default).filter(Boolean)
${clientConfigFiles
.map(
(filePath, index) => `import * as clientConfig${index} from '${filePath}'`,
)
.join('\n')}
export const clientConfigs = [
${clientConfigFiles.map((_, index) => ` clientConfig${index},`).join('\n')}
].map((m) => m.default).filter(Boolean)
`

await app.writeTemp('internal/clientConfigs.js', content)
Expand Down

0 comments on commit d378e34

Please sign in to comment.