vite-svg-sprite-wrapper icon indicating copy to clipboard operation
vite-svg-sprite-wrapper copied to clipboard

Sprite is not being served

Open janein opened this issue 10 months ago • 5 comments

Hi,

everything works fine on build/prod mode, but during the serve-mode the svg-sprite is not accessible. It gets requested via https://MY_IP:3000/static/app/dist/svg-icons.svg, but is not being served by vite.

My code:

ViteSvgSpriteWrapper({
      icons: './assets/base/icons/**/*.svg',
      outputDir: './public/static/app/dist/',
      sprite: {
          shape: {
              transform: ['svgo'],
          },
          mode: {
              symbol: {
                  dest: '.',
                  sprite: 'svg-icons.svg',
              },
          },
      },
  }),

In build mode it gets listed in the manifest and everything looks great. Any idea why it is not being served?

(also tried other outputDir, etc.)

janein avatar Apr 19 '24 10:04 janein