Skip to content

Use relative paths for imports in bundled shiki worker#192

Closed
lindsayzhng wants to merge 2 commits intomainfrom
lindsay/bundled-worker-use-relative-imports
Closed

Use relative paths for imports in bundled shiki worker#192
lindsayzhng wants to merge 2 commits intomainfrom
lindsay/bundled-worker-use-relative-imports

Conversation

@lindsayzhng
Copy link
Contributor

@lindsayzhng lindsayzhng commented Feb 4, 2026

Summary

the bundled worker doesn't recognize the vite alias imports, so they need to be relative

Test Plan

tested locally


Note

Medium Risk
Touches syntax-highlighting behavior and worker loading paths; regressions could impact rendering performance or highlighting availability for large code blocks, but changes are localized.

Overview
Fixes the bundled Shiki worker failing to resolve Vite alias imports by switching its dynamic imports to relative module paths (e.g., ./constants.js, ./get-code-styling.js, ./snippet-presets.js).

Refines getShikiHighlightedHtml large-input behavior: skips highlighting for extremely large blocks (> MAX_PREVIEW_BYTES * 5), prefers the worker for inputs > MAX_PREVIEW_BYTES when async is allowed, and if the worker path fails it now falls back to synchronous highlighting instead of returning undefined.

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

@lindsayzhng lindsayzhng marked this pull request as draft February 4, 2026 18:48
@lindsayzhng
Copy link
Contributor Author

not needed anymore

@lindsayzhng lindsayzhng closed this Feb 5, 2026
@lindsayzhng lindsayzhng deleted the lindsay/bundled-worker-use-relative-imports branch February 5, 2026 18:12
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