Can you run code from an external file?

I am making a SPA that uses SVGs with content like this:

<svg>
  <image :xlink:href="require(`@/assets/roomplan-${this.$store.getters.booking.hotel}.png`)" />
  <rect
     v-on:click="toggleRoom('r20')"
     x="121.97501"
     y="13.406374">
  </rect>
</svg>

The SVGs calls vuejs functions and axios store.

The problem is, when the application is deployed, I will need to add more of these SVG files to the project from time to time. The way it is structured now, I will need to re-build the project each time.

Can these SVG files be made external to the project, so that I can upload new SVG files, and they will work in the project without having to rebuild the project everytime ?

The code provided is currently not properly formatted for this forum. In its current state, it’s hardly readable and makes it hard for people to help you.

Please read the following guide about how to properly format code, and then edit your topic accordingly.

Thanks!