Now i'm using soundfont-player which provides ESM and typescript compared to midi.js. Due to the number and size of the soundfonts, it fetches them from the server at times, which is not in the plan to support all behavior including sound, offline through PWA. Currently, it can be cached by putting it in public directory which for static assets and increasing the maximum size of the file to be cached in the workbox, while the size of the application will reach 2GB. The sound I'll use is limited, and I want to get convenience in development, so I want to import the soundfonts using ESM import. I believe in Vite's tree-shaking when building.
Problem
Now i'm using soundfont-player which provides ESM and typescript compared to midi.js. Due to the number and size of the soundfonts, it fetches them from the server at times, which is not in the plan to support all behavior including sound, offline through PWA. Currently, it can be cached by putting it in public directory which for static assets and increasing the maximum size of the file to be cached in the workbox, while the size of the application will reach 2GB. The sound I'll use is limited, and I want to get convenience in development, so I want to import the soundfonts using ESM import. I believe in Vite's tree-shaking when building.