fix: use importmap to resolve spessasynth_core bare import
- Add importmap in index.html to map spessasynth_core to CDN URL - Load spessasynth_lib from CDN directly (with importmap resolving deps) - WorkerSynthesizer fallback also uses CDN import - Ensures library and processor use same spessasynth_core version
This commit is contained in:
@@ -10,11 +10,18 @@
|
||||
<script src="https://unpkg.com/lucide@latest"></script>
|
||||
<script src="https://unpkg.com/react@18.3.1/umd/react.production.min.js"></script>
|
||||
<script src="https://unpkg.com/react-dom@18.3.1/umd/react-dom.production.min.js"></script>
|
||||
<script type="importmap">
|
||||
{
|
||||
"imports": {
|
||||
"spessasynth_core": "https://cdn.jsdelivr.net/npm/spessasynth_core@latest/dist/spessasynth_core.mjs"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
import { WorkletSynthesizer } from 'https://esm.sh/spessasynth_lib@4.3.1';
|
||||
import { WorkletSynthesizer } from 'https://cdn.jsdelivr.net/npm/spessasynth_lib@4.3.1/dist/index.js';
|
||||
window.SpessaSynthClass = WorkletSynthesizer;
|
||||
window.__SpessaSynthCDN = '/static/js/services/';
|
||||
console.log('[SonicSF] SpessaSynth library loaded via esm.sh.');
|
||||
window.__SpessaSynthCDN = 'https://cdn.jsdelivr.net/npm/spessasynth_lib@4.3.1/dist/';
|
||||
console.log('[SonicSF] SpessaSynth library loaded from CDN.');
|
||||
</script>
|
||||
<script src="/static/js/services/api.js?v=202607232105"></script>
|
||||
<script src="/static/js/services/audioEngine.js?v=202607232105"></script>
|
||||
|
||||
Reference in New Issue
Block a user