-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Firstly, I'd like to give a massive thanks to @manuelodelain for taking over and maintaining this project for the last 18 months (especially as I haven't personally used Nuxt at all in that time, so my understanding and experience of the ecosystem right now is limited at best).
I've been thinking recently about whether this module does too much.
The main reason I made it, and the primary value that I've gotten out of it, is a maintained and updated list of existing rules so that they can be removed and overridden:
Lines 3 to 10 in 2e8f33b
| /** | |
| * This is the original RegExp cloned from the original Nuxt.js configuration | |
| * files, with only the search for ".svg" files removed. Keep tabs on this in | |
| * case the core decides to add additional qualifiers to the pattern. | |
| */ | |
| const ORIGINAL_TEST = /\.(png|jpe?g|gif|svg|webp|avif)$/i; | |
| const ORIGINAL_TEST_OLD_NUXT = /\.(png|jpe?g|gif|svg|webp)$/i; | |
| const REPLACEMENT_TEST = /\.(png|jpe?g|gif|webp|avif)$/i; |
This allows for flexibility and customisation of the SVG rules. So what did I do with all that newfound flexibility? Created a module that hardcoded more fixed rules to replace the existing ones! 🤦♀️ With the benefit of hindsight, this feels over-engineered and frustrating. Please feel free to disagree with me here, but defining your own rule as you need it in your own config is an extremely trivial task:
Lines 89 to 95 in 2e8f33b
| { | |
| resourceQuery: /sprite/, | |
| use: { | |
| loader: "svg-sprite-loader", | |
| options: options.svgSpriteLoader || {}, | |
| }, | |
| }, |
As I don't know whether or not this module is still needed, I'd like to propose that we do one of the following things:
- Archive the repository (if it's no longer offering value in the current ecosystem)
- Publish a new major version that simply acts as an SVG rule "cleaner", and update the README.md to show how to use it to add your own SVG rules that can use whatever loaders you need/want
- Keep on maintaining this project as is with no change in direction
I shall await your feedback :)