Skip to content

Cant resolve path #54

@julius-spudvilas

Description

@julius-spudvilas

I have been at this all day but it seems that plugin cant resolve path correctly as per README.md

Clean new VITE project with VUE

Vite.config.js

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import VitePluginSvgSpritemap from "@spiriit/vite-plugin-svg-spritemap";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), VitePluginSvgSpritemap("./src/svgIcons/*.svg")],
});

App.vue template

<template>
  <div>
    <svg>
      <use xlink:href="/__spritemap#sprite-circle-heat" />
    </svg>
  </div>
</template>

Console:
21.50.13 [vite] Internal server error: Failed to resolve import "/__spritemap" from "src/App.vue". Does the file exist?

Notes:
"../__spritemap#sprite-circle-heat" works on DEV but then cant be resolved on BUILD as it becomes "../assets/spritemap.197f1118.svg"

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions