You may be better off copying the mp3 file to the ‘resources’ folder in your mendix project after webpack has finished.
You can use the webpack shell plugin to automate this:
https://www.npmjs.com/package/webpack-shell-plugin
and copy it to <mx_project>/theme/resources.
You can reference it in your widget as:
http://localhost:8080/resources/beep/mp3.
Or simplify it even more – take the mp3 file out of the webpack build and just commit it into your theme/resources folder in mendix.
If:
- You do not need to use your widget outside of Mendix
- Your mp3 file is not generated by the widget build/doesn’t change oftent
Then I would just put it into your theme/resources folder and reference it in your widget from there.