Skip to content

Fix the Vite plugin notes from the #108 review - #109

Merged
alekswebnet merged 2 commits into
mainfrom
docs/pdfjs-viewer-plugin-review
Nov 24, 2026
Merged

alekswebnet merged 2 commits into
mainfrom
docs/pdfjs-viewer-plugin-review

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes the four review comments on #108, which merged before they were addressed. All four were correct:

  • Resource attributes (the comment on line 250): the page said assets-base or a resource attribute makes the plugin's copy unused. Only assets-base does that. A resource attribute such as c-map-url replaces only its own folder, and the element still loads the rest from the plugin's copy. This matches getResourceOption in the element.
  • Frameworks bullet (the two comments on line 362): it named only SvelteKit, Nuxt and Astro, so a React or Vue app on plain Vite, or a React Router app, could read past it. It now says any Vite app, with those four as examples.
  • Migrating from 4.5.0 (the comment on line 538): it said the plugin can replace the copy of dist, but not that assets-base has to go. While assets-base is set, the element ignores the plugin's copy. The step now says to add the plugin and then remove assets-base, any resource attributes that point at the copy, and the copy step.

Validation

pnpm build passes, and every href="#…" on _site/pdfjs-viewer/index.html matches an id, including the new link to #pdf-js-resources.

🤖 Generated with Claude Code


Summary by cubic

Fixes the four review notes on #108, which merged before they were addressed. The docs now match how the element and plugin actually behave.

  • A resource attribute such as c-map-url replaces only its own folder; only assets-base makes the plugin's copy unused. Without assets-base, the folders an attribute doesn't replace come from the plugin's copy.
  • The plugin note now says the Vite plugin works in any Vite app, with SvelteKit, Nuxt, Astro and React Router as examples.
  • The 4.5.0 migration step now says to add the plugin, then remove assets-base, any resource attributes pointing at the copy, and the copy step, since the element ignores the plugin's copy while assets-base is set.

Written for commit 3a5bcd2. Summary will update on new commits.

View guided diff Turn on auto-fix

A resource attribute replaces only its own folder, so only assets-base
makes the plugin's copy unused. The frameworks bullet now covers any
Vite app, React Router included. The 4.5.0 migration step says to remove
assets-base and the copy, since the element ignores the plugin's copy
while assets-base is set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread src/pdfjs-viewer/index.md Resolved
With assets-base set, the folders an attribute doesn't replace come
from assets-base, not from the plugin's copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alekswebnet
alekswebnet merged commit fae83db into main Nov 24, 2026
4 checks passed
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