score-viewer 1.0.44 → 1.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -99,6 +99,21 @@ function App() {
99
99
  }
100
100
  ```
101
101
 
102
+ ### Usage with Vite
103
+
104
+ If you are using Vite, you must exclude `score-viewer` from dependency optimization to ensure the Verovio worker is loaded correctly. Add this to your `vite.config.ts`:
105
+
106
+ ```typescript
107
+ export default defineConfig({
108
+ // ...
109
+ optimizeDeps: {
110
+ exclude: ['score-viewer']
111
+ }
112
+ })
113
+ ```
114
+
115
+ This is necessary because `score-viewer` uses a web worker that references external assets, which can be mishandled by Vite's dependency pre-bundling. Excluding it from optimization ensures the worker is loaded correctly without impacting performance.
116
+
102
117
  ### As an Iframe in Hugo or other static sites
103
118
 
104
119
  You can embed the Score Viewer in any static site using an iframe. This is perfect for Hugo sites or any non-React web environment.