vbenjs / vite-plugin-svg-icons

Vite Plugin for fast creating SVG sprites.
MIT License
795 stars 107 forks source link

Update SVGO to fix deprecation dependency warning #84

Open felixranesberger opened 1 year ago

felixranesberger commented 1 year ago

On installation of this package, a warning occurs. This should be fixable by updating SVGO to a newer version, since the deprecated dependency stable seems updated to a newer version in SVGO v3.

Screenshot 2023-02-04 at 18 40 04 Screenshot 2023-02-04 at 18 40 16
jonkab commented 3 months ago

Hello, I have a similar problem. Has anyone resolved the problem? Thanks in advance.

image

felixranesberger commented 3 months ago

You could try using overrides to update svgo internally yourself. Could look something like this:

"overrides": {
    "vite-plugin-svg-icons": {
      "svgo": "~3.0.0"
    }
  }

Haven't tried or tested it though. If this works for you, it would be awesome if you could give me some feedback with your current implementation of the fix, because I'm also facing the issue currently :)

jonkab commented 3 months ago

Thank you 🙏 for your suggestion! But unfortunately 😞 that doesn't seem to work either.

Code package.json

{
  "name": "vite-starter",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "devDependencies": {
    "vite": "^5.2.10"
  },
  "dependencies": {
    "vite-plugin-svg-icons": "^2.0.1"
  },
  "overrides": {
    "vite-plugin-svg-icons": {
      "svgo": "~3.0.0"
    }
  }
}

obtained result image

felixranesberger commented 3 months ago

This could work:

"overrides": {
    "svg-baker": {
      "micromatch": "^4.0.0"
    }
  }

(svgo wasn't the problem but a sub-sub-dependency of svg-baker)

jonkab commented 3 months ago

Well done ! Indeed ! 👍 But there is still the stable@0.1.8 library which is causing problems now.🤔

package.json

{
  "name": "vite-starter",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "devDependencies": {
    "vite": "^5.2.10"
  },
  "dependencies": {
    "vite-plugin-svg-icons": "^2.0.1"
  },
  "overrides": {
    "svg-baker": {
      "micromatch": "^4.0.0"
    }
  }
}

Screenshot image

felixranesberger commented 3 months ago

This should fix it

"overrides": {
    "svg-baker": {
      "micromatch": "^4.0.0"
    },
    "vite-plugin-svg-icons": {
      "svgo": "^3.2.0"
    }
  }
jonkab commented 3 months ago

It's still the same error, I don't know why.

package.json

{
  "name": "vite-starter",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "devDependencies": {
    "vite": "^5.2.10"
  },
  "dependencies": {
    "vite-plugin-svg-icons": "^2.0.1"
  },
  "overrides": {
    "svg-baker": {
      "micromatch": "^4.0.0"
    },
    "vite-plugin-svg-icons": {
      "svgo": "^3.2.0"
    }
  }
}

Screenshot image

felixranesberger commented 3 months ago

Weird, did you try removing the node_modules and running npm install again? I tried it on my project and I don't get the warning. Haven't tried if it works yet though.

felixranesberger commented 3 months ago

Could you resolve your error?