Skip to content

build: export BuildConfig type#74

Merged
pi0 merged 1 commit intounjs:mainfrom
ByScripts:patch-1
Feb 24, 2026
Merged

build: export BuildConfig type#74
pi0 merged 1 commit intounjs:mainfrom
ByScripts:patch-1

Conversation

@ByScripts
Copy link
Copy Markdown
Contributor

Re-export BuildConfig type from obuild/config

When using build.config.ts with export default defineBuildConfig(...), TypeScript emits the following error:

The inferred type of 'default' cannot be named without a reference to './node_modules/obuild/dist/_chunks/types.mjs'. This is likely not portable. A type annotation is needed. ts(2742)

This happens because BuildConfig is not re-exported from obuild/config, so TypeScript cannot name the return type of defineBuildConfig() without referencing an internal path.

Fix

Re-export BuildConfig from src/config.ts.

This allows consumers to annotate the type explicitly if needed, and resolves the ts(2742) error.

## Re-export `BuildConfig` type from `obuild/config`

When using `build.config.ts` with `export default defineBuildConfig(...)`, TypeScript emits the following error:

```
The inferred type of 'default' cannot be named without a reference to './node_modules/obuild/dist/_chunks/types.mjs'. This is likely not portable. A type annotation is needed. ts(2742)
```

This happens because `BuildConfig` is not re-exported from `obuild/config`, so TypeScript cannot name the return type of `defineBuildConfig()` without referencing an internal path.

### Fix

Re-export `BuildConfig` from `src/config.ts`.

This allows consumers to annotate the type explicitly if needed, and resolves the ts(2742) error.
@pi0 pi0 changed the title Re-export BuildConfig type from config.ts build: export BuildConfig type Feb 24, 2026
@pi0 pi0 merged commit d198ac3 into unjs:main Feb 24, 2026
3 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.39%. Comparing base (bd11b30) to head (6c3cfad).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #74   +/-   ##
=======================================
  Coverage   61.39%   61.39%           
=======================================
  Files           6        6           
  Lines         417      417           
  Branches      129      129           
=======================================
  Hits          256      256           
  Misses        120      120           
  Partials       41       41           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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