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

fix: change import to use type import for buildConfig from 'payload' #11578

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

y4aniv
Copy link

@y4aniv y4aniv commented Mar 6, 2025

What?

Updated the import statement for buildConfig from import { buildConfig } from 'payload' to import type { buildConfig } from 'payload' to properly handle TypeScript types.

Why?

This change ensures that TypeScript properly treats buildConfig as a type rather than a runtime import, following project conventions and ensuring consistency with the rest of the documentation and code.

@AlessioGr
Copy link
Member

buildConfig is a function that we call during runtime and is not just used as a type here. We can't strip it out when we compile the project

@AlessioGr AlessioGr closed this Mar 6, 2025
@AlessioGr AlessioGr reopened this Mar 6, 2025
@AlessioGr
Copy link
Member

Adding type to the GlobalConfig imports is good though - if you remove the buildConfig change, this should be fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants