Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): allow non-default-export client config file #1564

Merged
merged 9 commits into from
May 23, 2024
6 changes: 4 additions & 2 deletions packages/core/src/app/prepare/prepareClientConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ export const prepareClientConfigs = async (app: App): Promise<void> => {
// generate client config files entry
const content = `\
${clientConfigFiles
.map((filePath, index) => `import clientConfig${index} from '${filePath}'`)
.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
Loading