score-viewer 1.0.44 → 1.0.46
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 +15 -0
- package/dist/score-viewer.js +14021 -13996
- package/dist/score-viewer.js.map +1 -1
- package/dist/score-viewer.umd.cjs +85 -85
- package/dist/score-viewer.umd.cjs.map +1 -1
- package/dist/types/main.d.ts +168 -16
- package/package.json +1 -1
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.
|