Skip to content

fix: handle windows paths in umd-to-esm#103

Open
RYGRIT wants to merge 2 commits intonpmx-dev:mainfrom
RYGRIT:fix/plugin-umd-to-esm-clean
Open

fix: handle windows paths in umd-to-esm#103
RYGRIT wants to merge 2 commits intonpmx-dev:mainfrom
RYGRIT:fix/plugin-umd-to-esm-clean

Conversation

@RYGRIT
Copy link
Copy Markdown
Collaborator

@RYGRIT RYGRIT commented Apr 10, 2026

The previous replacement only matched /umd/, so Windows paths were not converted to the ESM entry. This caused the built language server to load the wrong jsonc-parser bundle and fail at startup.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8a2c8b43-59d5-413b-8f2f-e30705472692

📥 Commits

Reviewing files that changed from the base of the PR and between a269e87 and 5ca8f8c.

📒 Files selected for processing (1)
  • plugins/umd-to-esm.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/umd-to-esm.ts

📝 Walkthrough

Walkthrough

The plugin’s UMD→ESM path rewriting was refactored to use a new exported helper toEsmPath(resolvedModulePath: string) that replaces the /umd/ segment via a cross‑platform regex (/[/\\]umd[/\\]/) and maps it to esm. Module resolution now computes resolvedModulePath with require.resolve(source) and derives id from toEsmPath(...) instead of an inline string replace. createRequire now uses importer ?? import.meta.url as its argument.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description accurately describes the core issue being fixed: handling Windows paths in the UMD-to-ESM conversion by using cross-platform regex matching instead of hardcoded forward slashes.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 700d15a1-4a58-46fe-af70-cd185d24a28f

📥 Commits

Reviewing files that changed from the base of the PR and between 0d92ae7 and a269e87.

📒 Files selected for processing (1)
  • plugins/umd-to-esm.ts

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