owncloud / web

:dragon_face: Next generation frontend for ownCloud Infinite Scale
https://owncloud.dev/clients/web/
GNU Affero General Public License v3.0
447 stars 157 forks source link

Load assets of extension #2958

Open LukasHirt opened 4 years ago

LukasHirt commented 4 years ago

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)

LukasHirt commented 4 years ago

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:

dschmidt commented 1 year ago

Using import.meta.url might have become much easier as we're switching to native modules in https://github.com/owncloud/web/pull/7952

pascalwengerter commented 2 months ago

Is this issue still relevant given the progress that has been achieved in the overall project and extension system?

dschmidt commented 2 months ago

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