-
Notifications
You must be signed in to change notification settings - Fork 135
Closed
Copy link
Description
Describe the bug
When building a library that imports UserConfig from vite-plus via vp pack, the d.ts bundler (rolldown-plugin-dts) emits ~137 warnings. These are caused by type definition issues in @voidzero-dev/vite-plus-core and @voidzero-dev/vite-plus-test packages.
Reproduction
https://github.com/kazupon/vp-config
Steps to reproduce
git clone https://github.com/kazupon/vp-config.git
cd vp-config
vp install
vp packThe library imports UserConfig from vite-plus:
// https://github.com/kazupon/vp-config/blob/main/src/format.ts
import type { UserConfig } from 'vite-plus'System Info
vp v0.1.12
vite-plus v0.1.12
@voidzero-dev/vite-plus-core v0.1.12
@voidzero-dev/vite-plus-test v0.1.12
postcss v8.5.8
lightningcss v1.32.0Used Package Manager
pnpm
Logs
Output of `vp pack` in `@kazupon/vp-config` (postcss warnings condensed):
VITE+ - The Unified Toolchain for the Web
ℹ entry: src/index.ts
ℹ tsconfig: tsconfig.json
ℹ Build start
ℹ Cleaning 2 files
The `tsgo` option is experimental and may change in the future.
(rolldown-plugin-dts:fake-js plugin) `declare module "../@vitest/expect/index.js"` will be kept as-is in the output. Relative module declaration may cause unexpected issues. Found in .../node_modules/@voidzero-dev/vite-plus-test/dist/chunks/global.d.x-ILCfAE.d.ts.
(rolldown-plugin-dts:fake-js plugin) `declare module "../@vitest/runner/index.js"` will be kept as-is in the output. Relative module declaration may cause unexpected issues. Found in .../node_modules/@voidzero-dev/vite-plus-test/dist/chunks/global.d.x-ILCfAE.d.ts.
ℹ Hint: consider adding deps.onlyBundle option to avoid unintended bundling of dependencies, or set deps.onlyBundle: false to disable this hint.
See more at https://tsdown.dev/options/dependencies#deps-onlybundle
Detected dependencies in bundle:
- @voidzero-dev/vite-plus-core
- @oxc-project/types
- postcss
- @voidzero-dev/vite-plus-test
- @types/deep-eql
- assertion-error
- @types/chai
- oxlint
- vite-plus
- oxfmt
ℹ dist/index.mjs 5.40 kB │ gzip: 1.59 kB
ℹ dist/index.d.mts 718.36 kB │ gzip: 164.19 kB
ℹ 2 files, total: 723.76 kB
node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/postcss.d.mts (1:9) [MISSING_EXPORT] Warning: "AcceptedPlugin" is not exported by "node_modules/.pnpm/postcss@8.5.8/node_modules/postcss/lib/postcss.d.ts".
... (129 postcss MISSING_EXPORT warnings total, all from postcss .d.ts files using `import` instead of `import type`)
.../vite-plus-core/dist/vite/types/internal/lightningcssOptions.d.ts (1:7) [MISSING_EXPORT] Warning: "default" is not exported by ".../lightningcss/node/index.d.ts".
│
1 │ import Lightningcss from 'lightningcss';
│ ──────┬─────
│ ╰─────── Missing export
│
│ Note: If you meant to import a type rather than a value, make sure to add the `type` modifier (e.g. `import { type Foo } from 'lightningcss'`).
.../vite-plus-test/dist/chunks/reporters.d.DVUYHHhe.d.ts (18:9) [MISSING_EXPORT] Warning: "CDPSession" is not exported by ".../vite-plus-test/dist/@vitest/browser/index.d.ts".
│
18 │ import { CDPSession, BrowserCommands } from '../@vitest/browser/index.js';
│ ─────┬────
│ ╰────── Missing export
.../vite-plus-test/dist/chunks/reporters.d.DVUYHHhe.d.ts (18:21) [MISSING_EXPORT] Warning: "BrowserCommands" is not exported by ".../vite-plus-test/dist/@vitest/browser/index.d.ts".
│
18 │ import { CDPSession, BrowserCommands } from '../@vitest/browser/index.js';
│ ───────┬───────
│ ╰───────── Missing export
.../vite-plus-test/dist/node.d.ts (21:9) [MISSING_EXPORT] Warning: "CDPSession" is not exported by ".../vite-plus-test/dist/@vitest/browser/index.d.ts".
│
21 │ export { CDPSession } from './@vitest/browser/index.js';
│ ─────┬────
│ ╰────── Missing export
.../vite-plus-test/dist/index.d.ts (15:71) [MISSING_EXPORT] Warning: "ExpectPollOptions" is not exported by ".../vite-plus-test/dist/@vitest/expect/index.d.ts".
│
15 │ export { ..., ExpectPollOptions, ... } from './@vitest/expect/index.js';
│ ────────┬────────
│ ╰────────── Missing export
.../vite-plus-test/dist/@vitest/browser/matchers.d.ts (3:20) [MISSING_EXPORT] Warning: "ExpectPollOptions" is not exported by ".../vite-plus-test/dist/index.d.ts".
│
3 │ import { Assertion, ExpectPollOptions } from '../../index.js';
│ ────────┬────────
│ ╰────────── Missing export
✔ Build complete in 817msValidations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackPriority
None yet
Effort
None yet