jpkleemans / vite-svg-loader

Vite plugin to load SVG files as Vue components
MIT License
554 stars 58 forks source link

fix: process with plugin raw svg #117

Open wasap opened 1 year ago

jpkleemans commented 12 months ago

Hi, thanks for your PR! Could you add a Cypress test that shows the problem this PR solves? (That test should fail without your fix)

wasap commented 12 months ago

when i used in webpack raw svgo loader

 {
                loader: 'svgo-loader',
                options: {
                  plugins: [
                    'preset-default',
                    'prefixIds',
                    { 'name': 'removeViewBox', 'active': false },
                    { 'name': 'removeDimensions' },
                    {
                      'name': 'removeAttrs',
                      'params': {
                        attrs: '*:(stroke|fill):((?!^none$).)*',
                      },
                    },
                  ],
                },
              },

it responded me svg with plugins applied, but here i found that you just return raw text without processing. so i made it similar to webpack

jpkleemans commented 7 months ago

Thanks for your explanation. I understand it now! Can you fix my comment? Then i'll merge it

digitalkaoz commented 3 months ago

@jpkleemans any progress on this? can you apply the change yourself?

wasap commented 2 months ago

hi, i fixed your request, please reviw