iest / babel-plugin-inline-svg

Babel plugin to optimise and inline svg
49 stars 15 forks source link

Add option to prevent renaming id namespace #15

Closed hanc2006 closed 4 years ago

hanc2006 commented 4 years ago

I didn't find a way to prevent the renaming id namespace. It would be nice to be able to disable this feature with a new configuration entry :)

moelders commented 4 years ago

Hello @hanc2006, @iest , I have been working on this issue because I had the same problem, I have seen that the prefix option comes with the plugin prefixIds, so, it is not necessary to force the prefix (documentation).

You can see the changes and documentation in my fork: moelders/babel-plugin-inline-svg.

As I have no permissions to publish, and this repository seems to have no maintenance, the plugin can be installed via GitHub:

{
  "devDependencies": {
    "babel-plugin-inline-svg": "moelders/babel-plugin-inline-svg#semver:1.1.1"
  }
}
iest commented 4 years ago

@moelders if you open a PR I'd be happy to check it out — from a brief look at your branch it's only some of adidas-specific eslint rules that would need to change.

I've been meaning to do a general cleanup of this repo for a while, so that would be a great place to start 🙌

moelders commented 4 years ago

Hello @iest, I am sorry for my late reply. As I use it in @adidas organization, I added adidas Eslint rules, however, it is not the focus of the changes. The problem was that the namespace was always renamed and it creates inconsistencies. So, the prefixIds should not force it if it is empty. Let me know if you want to add my changes so I can open a PR to the main repository.

iest commented 4 years ago

@moelders please feel free to open a PR! I will happily help to get this change in

moelders commented 4 years ago

Some days late but the PR is open: #19.

iest commented 4 years ago

This issue was solved in #22