[PR #11506] fix(config): optimize dependency installation to use global cache (#11147) #13817

Open
opened 2026-02-16 18:18:39 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11506

State: open
Merged: No


Fixes #11147
fix(config): optimize dependency installation to use global cache

Problem:

  • OpenCode was creating node_modules in every .opencode directory
  • Each installation duplicated @opencode-ai/plugin (~6MB each)
  • Wasted disk space when working across multiple projects

Solution:

  • Install @opencode-ai/plugin to ~/.cache/opencode/node_modules/ (shared global cache)
  • Only create local node_modules when package.json has custom dependencies
  • Skip dependency installation entirely if package.json does not exist

Result:

  • Reduces disk usage by sharing @opencode-ai/plugin across all projects
  • Maintains ability for users to add custom dependencies locally
  • No longer creates redundant node_modules directories
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11506 **State:** open **Merged:** No --- Fixes #11147 fix(config): optimize dependency installation to use global cache Problem: - OpenCode was creating node_modules in every .opencode directory - Each installation duplicated @opencode-ai/plugin (~6MB each) - Wasted disk space when working across multiple projects Solution: - Install @opencode-ai/plugin to ~/.cache/opencode/node_modules/ (shared global cache) - Only create local node_modules when package.json has custom dependencies - Skip dependency installation entirely if package.json does not exist Result: - Reduces disk usage by sharing @opencode-ai/plugin across all projects - Maintains ability for users to add custom dependencies locally - No longer creates redundant node_modules directories
yindo added the pull-request label 2026-02-16 18:18:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13817