Skip to content
This repository was archived by the owner on Jan 4, 2023. It is now read-only.
This repository was archived by the owner on Jan 4, 2023. It is now read-only.

Load images from a folder dynamically (?) #227

@endredev

Description

@endredev

I can load images dynamically from a folder in Nuxt (+ webpack) simply with a method like:

getServiceIcon(iconName) {
    return require ('../../static/images/svg/services/' + iconName + '.svg');
  }

Then I moved to Vite, and Require is not defined here (using rollup). How can I solve this, with nuxt / vite? Any idea?
So I'd like to load all the SVG-s from the given folder somehow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions