Skip to content

SVG not loading when using resolved path #795

@PierBover

Description

@PierBover

When using a relative path SVGs load fine:

<img src="../../../assets/logo.svg">

It works and in the DOM I get:

<img src="data:image/svg+xml....">

But this is a pain if you start nesting folders of components so I tried creating an alias:

'assets': path.resolve(__dirname, '../src/assets')

to be able to do:

<img src="assets/logo.svg">

But when doing this the SVG data is not required properly and instead of getting src="data:image/svg+xml...." in the DOM I get exactly src="assets/logo.svg".

Is this a problem with the webpack configuration of the template or am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions