Skip to content

feat(plugin): make esbuild resolution resilient to package managers#366

Merged
jackwener merged 1 commit intomainfrom
feat/plugin-esbuild-resolve
Mar 24, 2026
Merged

feat(plugin): make esbuild resolution resilient to package managers#366
jackwener merged 1 commit intomainfrom
feat/plugin-esbuild-resolve

Conversation

@ByteYue
Copy link
Collaborator

@ByteYue ByteYue commented Mar 24, 2026

Description

Replaces the hardcoded node_modules/.bin/esbuild lookup with a robust multi-stage resolution strategy.

  • Adds resolveEsbuildBin() with 3 fallbacks
  • Stage 1: Leverages import.meta.resolve to parse the actually installed esbuild/package.json and find its declared bin file.
  • Stage 2: Falls back to the raw node_modules/.bin path.
  • Stage 3: Falls back to the global PATH via which esbuild.
  • Updates transpilePluginTs() to use this new helper.

This prevents silent transpilePluginTs failures on developer machines or custom environments where package managers like pnpm hoist bins differently.

@jackwener jackwener force-pushed the feat/plugin-esbuild-resolve branch from 2870e02 to 0f9ea24 Compare March 24, 2026 14:43
Copy link
Owner

@jackwener jackwener left a comment

Choose a reason for hiding this comment

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

Deep review completed. I kept the esbuild resolution fallback idea, rebased it onto current plugin infrastructure, and kept the patch focused on the actual resilience fix plus targeted coverage.

@jackwener jackwener merged commit 316b495 into main Mar 24, 2026
@jackwener jackwener deleted the feat/plugin-esbuild-resolve branch March 24, 2026 14:43
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