Skip to content

docs: change import to use type import for GlobalConfig#11578

Merged
r1tsuu merged 3 commits intopayloadcms:mainfrom
y4aniv:patch-1
Apr 10, 2026
Merged

docs: change import to use type import for GlobalConfig#11578
r1tsuu merged 3 commits intopayloadcms:mainfrom
y4aniv:patch-1

Conversation

@y4aniv
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
Member

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

@github-actions github-actions Bot added the stale label Apr 6, 2025
@github-actions github-actions Bot removed the stale label Jan 21, 2026
@github-actions github-actions Bot added the stale label Feb 20, 2026
@r1tsuu r1tsuu changed the title fix: change import to use type import for buildConfig from 'payload' docs: change import to use type import for GlobalConfig Apr 10, 2026
@r1tsuu r1tsuu enabled auto-merge (squash) April 10, 2026 12:35
@r1tsuu r1tsuu merged commit 289e2b6 into payloadcms:main Apr 10, 2026
18 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🚀 This is included in version v3.83.0

milamer pushed a commit to milamer/payload that referenced this pull request Apr 20, 2026
…1578)

### 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.

---------

Co-authored-by: Sasha Rakhmatulin <sasha@ritsuko.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants