For the UD-Sound, I would like to include sounds builtin, but how ti do this?
I have looked throught some of the other custom components, but I have not been able to find another one that do it
OK I figures it out
so the webpack.config define which stuff get copyed to “public”, and it does it by looking for all the “stuff” that are required/imported in the javascript.
So I did this in the javascript file
require.context(“./sounds/”, true, /^./.*.wav/);
The above is relative from the javascript file itself.
So I created a folder under “Components” named Sounds, and i will just dump all wav files in here.
I then add to the webpack file to also include wav files by adding wav to the file.loader
BUT… webpack are downloaded in full by clients right?
so if i added alot of wav files, I will end up with a huge webpack file for clients to download right?
so how do I include the files, but dont add it to the webpack?
but still able to “pack” it with the module, and expose it for users to download ondemand?
Check your output directory. I bet it doesn’t actually pack the wav files into the main bundle and will load them on demand. It kind of depends on how you are loading the wav files in JSX. You should be able to delay load them so only the ones that are used are downloaded. You will need to make sure to register the wav files with UD in the PSM1 file. You’ll see it’s registering a bunch of other files. Just make sure to register the wav files too.