Skip to content

Assets import #114

Open
Open
@GMartigny

Description

@GMartigny

Hi,

When importing assets (images for examples) inside HTML of svelte component, it's not processed by the loader and therefore neither by webpack.

example that don't work:

<img src="./statics/image.png"/>

workaround:

<script>
  import img from "./statics/image.png";
</script>
<img src="{img}"/>

You might be interested at the way vue-loader is doing it. I don't know if this is relevant to svelte tho.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions