Skip to content

Prebundle @pierre/diffs modules in web Vite config#75

Merged
juliusmarminge merged 1 commit intomainfrom
codething/58d1ebc2
Feb 19, 2026
Merged

Prebundle @pierre/diffs modules in web Vite config#75
juliusmarminge merged 1 commit intomainfrom
codething/58d1ebc2

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Feb 19, 2026

Summary

  • Add optimizeDeps.include to apps/web/vite.config.ts for @pierre/diffs, @pierre/diffs/react, and @pierre/diffs/worker/worker.js.
  • Mirror the same optimizeDeps.include change in apps/web/vite.config.js.
  • Ensure Vite prebundles these dependencies to reduce dev-time dependency resolution issues.

Testing

  • Not run (no test execution included in this change set).
  • Not run: lint checks.

Open with Devin

Note

Low Risk
Vite dev-tooling configuration only; no runtime business logic changes, but incorrect prebundling could cause local dev/startup issues.

Overview
Configures the web app’s Vite dev server to prebundle @pierre/diffs (including @pierre/diffs/react and the worker entry @pierre/diffs/worker/worker.js) via optimizeDeps.include.

This change is mirrored in both apps/web/vite.config.ts and apps/web/vite.config.js to reduce dev-time dependency resolution issues when using the diffs components/worker.

Written by Cursor Bugbot for commit 2eabd82. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Chores
    • Updated build configuration to improve application startup and loading performance.

- Add `optimizeDeps.include` entries for `@pierre/diffs` packages in web Vite config
- Improves dev startup/runtime stability for diff rendering modules
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Feb 19, 2026

Pre-bundle @pierre/diffs modules in the web app’s Vite dev config to include @pierre/diffs, @pierre/diffs/react, and @pierre/diffs/worker/worker.js

Add optimizeDeps.include entries for @pierre/diffs, @pierre/diffs/react, and @pierre/diffs/worker/worker.js in the web Vite config in both JS and TS variants. See vite.config.js and vite.config.ts.

📍Where to Start

Start with the defineConfig export in apps/web/vite.config.ts.


Macroscope summarized 2eabd82.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 19, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Added optimizeDeps.include configuration to Vite config files to pre-bundle specific @pierre dependencies (@pierre/diffs, @pierre/diffs/react, and @pierre/diffs/worker/worker.js) during development builds.

Changes

Cohort / File(s) Summary
Vite Configuration
apps/web/vite.config.js, apps/web/vite.config.ts
Added optimizeDeps.include array with three @pierre module paths for dependency pre-bundling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Prebundle @pierre/diffs modules in web Vite config' directly and accurately describes the main change: adding optimizeDeps.include entries to prebundle specific @pierre/diffs modules in the Vite configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codething/58d1ebc2

Comment @coderabbitai help to get the list of available commands and usage tips.

@juliusmarminge juliusmarminge merged commit 47fcd16 into main Feb 19, 2026
5 checks passed
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Feb 19, 2026

Greptile Summary

Added optimizeDeps.include configuration to prebundle @pierre/diffs, @pierre/diffs/react, and @pierre/diffs/worker/worker.js in Vite. This reduces dev-time dependency resolution issues when using the diffs components and worker in the web app.

  • Configured prebundling for the @pierre/diffs package and its submodules
  • Changes mirrored in both vite.config.ts and vite.config.js (Vite will use the .ts file)
  • The specified modules are imported in DiffPanel.tsx and diffs.worker.ts, confirming correct paths

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - it only configures Vite's dev server optimization
  • Dev-tooling configuration change that doesn't affect runtime behavior. The specified paths match actual imports in the codebase (DiffPanel.tsx and diffs.worker.ts), ensuring correctness. Only potential issue is the duplicate .js/.ts config files, but Vite will correctly prefer the .ts version.
  • No files require special attention

Important Files Changed

Filename Overview
apps/web/vite.config.ts Added optimizeDeps.include for @pierre/diffs modules to prebundle dependencies
apps/web/vite.config.js Mirrored optimizeDeps.include changes; duplicates vite.config.ts (Vite will prefer .ts file)

Last reviewed commit: 2eabd82

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread apps/web/vite.config.js
Comment on lines 1 to 44
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { tanstackRouter } from "@tanstack/router-plugin/vite";
import { defineConfig } from "vite";
const port = Number(process.env.PORT ?? 5173);
export default defineConfig({
plugins: [
tanstackRouter(),
react({
babel: {
plugins: [["babel-plugin-react-compiler", { target: "19" }]],
},
}),
tailwindcss(),
],
optimizeDeps: {
include: ["@pierre/diffs", "@pierre/diffs/react", "@pierre/diffs/worker/worker.js"],
},
define: {
// In dev mode, tell the web app where the WebSocket server lives
"import.meta.env.VITE_WS_URL": JSON.stringify(process.env.VITE_WS_URL ?? ""),
},
experimental: {
enableNativePlugin: true,
},
resolve: {
tsconfigPaths: true,
},
server: {
port,
strictPort: true,
hmr: {
// Explicit config so Vite's HMR WebSocket connects reliably
// inside Electron's BrowserWindow. Vite 8 uses console.debug for
// connection logs — enable "Verbose" in DevTools to see them.
protocol: "ws",
host: "localhost",
},
},
build: {
outDir: "dist",
emptyOutDir: true,
},
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both vite.config.js and vite.config.ts exist. Vite prefers .ts, making this file potentially unused. Consider removing to avoid confusion.

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.

1 participant