SpiriitLabs / vite-plugin-svg-spritemap

Vite plugin to generate svg spritemap
MIT License
53 stars 4 forks source link

Support for multiple instance #39

Closed Applelo closed 1 month ago

Applelo commented 10 months ago

Currently, multiple instance of the plugin are not possible because of the spritemap server. Make `/spritemapeditable by the user with theoutput.name` option ?

{

plugins: [
      VitePluginSvgSpritemap('./assets/icons/*.svg', {
        output: {
          filename: '[name].[hash][extname]',
          view: false,
        },
      }),
      VitePluginSvgSpritemap('./assets/flags/*.svg', {
        output: {
          filename: 'flags.[hash][extname]',
          view: false,
        },
      }),
    ],
}
shurco commented 10 months ago

Currently, multiple instance of the plugin are not possible because of the spritemap server. Make `/spritemapeditable by the user with theoutput.name` option ?

{

plugins: [
      VitePluginSvgSpritemap('./assets/icons/*.svg', {
        output: {
          filename: '[name].[hash][extname]',
          view: false,
        },
      }),
      VitePluginSvgSpritemap('./assets/flags/*.svg', {
        output: {
          filename: 'flags.[hash][extname]',
          view: false,
        },
      }),
    ],
}

try this way :

{
  plugins: [
    VitePluginSvgSpritemap([
      "./assets/icons/*.svg",
      "./assets/flags/*.svg",
    ], {
      output: {
        view: false,
      },
    }),
  ]
}
Applelo commented 10 months ago

Yeah I know, but I want to generate two spritemaps, one for my icons, and one for the flags :)

hybrid897 commented 6 months ago

@Applelo I have a similar scenario except with a set of map icons that I would like in a different spritemap. Is there an issue blocking the current PR you have raised? Thank you for the plugin :)

Applelo commented 6 months ago

The current PR is blocked because of lack of time on my part. I wish to make an update at the end of this month 🤞

liushuog commented 3 months ago

May I ask when version 2.3.0 can be released?

Applelo commented 3 months ago

The last time I give an estimate time, I was completely wrong. So what I can say: I am working on it every week. I need to finish the styles callback and add testing for all the new features 😅 7 months since no release is not what I was hoping for this plugin 🫤

For the next version, I hope to do more little release and fix all the bugs fixes reported by everyone (and enforce proper reproduction on issues 🥹).