Load assets of extension
At the moment we load only the js bundle of extension. We need to be able to also load assets in case there are any (e. g. images)
Possible solution - use import.meta.url which returns URL where the module is located and access assets with that URL. This is not supported in Edge. Seems that polyfill already exists though https://www.npmjs.com/package/es-module-shims
So the next tasks are:
- [ ] Test loading assets with this solution
- [ ] Test polyfill for Edge
- [ ] Document it so it's available for extensions developers.
Using import.meta.url might have become much easier as we're switching to native modules in https://github.com/owncloud/web/pull/7952
Is this issue still relevant given the progress that has been achieved in the overall project and extension system?
import.meta.url can be used as @LukasHirt pointed out.
c.f. https://github.com/dschmidt/web-app-gpx-viewer/blob/1c0ecfc52fc217bb1a1b4279b7ea445b9d78b1fa/src/composables/useLeaflet.ts#L16
Since it's already in use - closing