Conversation
…configuration and import paths.
fix: Rename pdf2svg WASM bindings to `pdf2svg-wasm` and update build …
There was a problem hiding this comment.
Pull request overview
This PR renames the WASM bindings exports from pdf2svg to pdf2svg-wasm in the distribution output to provide clearer naming for the compiled WASM module files.
- Updates the build script to copy WASM files with
-wasmsuffix in the dist directory - Modifies import paths in
wasm.tsto reference the renamed files - Updates Vite externalization configuration for the new naming pattern
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/ducsvg/vite.config.mts | Updates external dependencies list to match renamed WASM module exports and adds regex pattern for pdf2svg-wasm files |
| packages/ducsvg/src/wasm.ts | Updates re-export paths to reference the renamed pdf2svg-wasm files in dist |
| packages/ducsvg/package.json | Modifies copy script to rename output files to pdf2svg-wasm.js and pdf2svg-wasm.d.ts when copying to dist |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /\.wasm$/, // Don't bundle WASM files inline | ||
| 'ducpdf', | ||
| 'ducjs', | ||
| '/pdf2svg/pkg/', |
There was a problem hiding this comment.
The string '/pdf2svg/pkg/' should be a regex pattern. Change it to /pdf2svg/pkg// to properly match paths containing 'pdf2svg/pkg/'.
| '/pdf2svg/pkg/', | |
| /pdf2svg\/pkg\//, |
| 'ducpdf', | ||
| 'ducjs', | ||
| '/pdf2svg/pkg/', | ||
| /pdf2svg-wasm(\.js)?$/, | ||
| /\.wasm$/, |
There was a problem hiding this comment.
Removing the explanatory comments reduces code documentation. The previous comments explained why each dependency was externalized (e.g., "Uses Rust WASM - let consuming app handle", "Externalize pdf2svg wasm bindings to prevent inline base64 bundling"). Consider retaining these comments to help future maintainers understand the build configuration.
| 'ducpdf', | |
| 'ducjs', | |
| '/pdf2svg/pkg/', | |
| /pdf2svg-wasm(\.js)?$/, | |
| /\.wasm$/, | |
| 'ducpdf', // Uses Rust/WASM runtime; let consuming app handle loading and hosting | |
| 'ducjs', // Shared runtime library; avoid bundling so consumer can manage versioning | |
| '/pdf2svg/pkg/', // pdf2svg WASM package path; keep package layout and assets external | |
| /pdf2svg-wasm(\.js)?$/, // pdf2svg-wasm JS loader; avoid bundling to prevent inline base64 and keep loader external | |
| /\.wasm$/, // Externalize all WASM binaries so Vite/Rollup do not inline them; consuming app is responsible for fetching/serving WASM |
|
🎉 This PR is included in version 3.2.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 2.3.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 2.2.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 2.1.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
No description provided.