developテーマのpdfjs-dist直接依存を削除 - #53
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
themes/develop の
dependenciesからpdfjs-distを削除する。pdfjs-distはビルド時にvite-plugin-static-copyで worker/cmaps/wasm を静的コピーする目的のみで直接依存していたが、実際は@ablogcms/pdf(PDFプレビュー機能で既に依存済み)が内部でpdfjs-distに依存しているため、npm のホイストによりnode_modules/pdfjs-distは削除後も引き続き解決される。重複した依存宣言を無くし、pdf.js の API 本体とworkerファイルのバージョンを常に@ablogcms/pdf側で一元管理できるようにする。vite.config.jsのコピー元パスは変更していない(ホイストされたnode_modules/pdfjs-distを引き続き参照)。動作確認
npm install後node_modules/pdfjs-distが@ablogcms/pdf経由でホイストされることを確認npx vite buildでdist/pdfjs/pdf.worker.min.mjs等が変わらず出力されることを確認