lukeed / lukeed/comptime

comptime/rolldown fails with "Could not find package 'vite'" in Deno + rolldown environment

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
179
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Environment
- comptime version: 0.1.0
- rolldown version: 1.0.2
- Runtime: Deno (npm compatibility layer)
- No Vite in the project

Repro

Install comptime, add the rolldown plugin to a rolldown config, and run the build:

```ts
// rolldown.config.ts
import { comptime } from 'comptime/rolldown';
import { defineConfig } from 'rolldown';

export default defineConfig({
input: 'src/main.ts',
plugins: [comptime()],
});
```

Error

```
TypeError: Could not find package 'vite' from referrer
'file:///.../.../node_modules/comptime/dist/rolldown.js'
```

Expected behaviour

comptime/rolldown should work in any rolldown environment without requiring Vite as a peer dependency. Rolldown is a standalone bundler- projects using it may not have Vite installed at all.

Actual behaviour

comptime/rolldown's entry point imports from vite internally, causing a hard failure at startup when Vite is not present.

Analysis

The dist/rolldown.js entry point appears to share code with the Vite plugin and transitively pulls in a vite import. The rolldown plugin should be self-contained and not depend on Vite's module graph. The comptime/rollup export may have the same issue.

Suggested fix

Ensure comptime/rolldown (and comptime/rollup) have no direct or transitive imports from vite. The rolldown plugin's only external dependency at runtime should be rolldown's plugin API types, which are pure TypeScript interfaces.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the Deno reproduction with rolldown.config.ts, then inspect the comptime/rolldown entry point at dist/rolldown.js and trace its imports. Done means the rolldown plugin starts in a project without Vite and the related comptime/rollup export has no direct or transitive Vite dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.