bensampaio / external-svg-sprite-loader

A webpack loader and plugin that generate SVG sprites out of a collection of SVG files used in your JS and CSS files
MIT License
62 stars 24 forks source link

Support and compatibility with Webpack 4 regarding mini-css-extract-plugin #93

Closed thasmo closed 3 years ago

thasmo commented 3 years ago

First off, thanks for taking ownership of the package, maintaining and upgrading it for webpack 5. Thank a lot!

We ran into problems with external-svg-sprite-loader@6 and mini-css-extract-plugin@1.3 when running it wih webpack@4. I've noticed there was a fix for the latest major version 7.x, but it seems this fix was not implemented in the 6.x branch; which seems to me as if 6.x is not maintained anymore.

/node_modules/external-svg-sprite-loader/lib/SvgSprite.js:191
source = source.replace(originalResourcePathRegExp, resourcePath);
                ^
TypeError: source.replace is not a function

I understand that maintaining two separate versions is a lot of work but I hope you are considering adding the fix to the v6 version too, as mini-css-extract-plugin@1.3 supports webpack@4 as well afaik.

Thanks for your input on this issue!

thasmo commented 3 years ago

@bensampaio, is this something you'd consider?

bensampaio commented 3 years ago

@thasmo thanks for reporting this issue. I would like to help but since I maintain this plugin alone I can't offer support for all versions. Therefore, I chose to offer support only for the current major version. Is there no option for you to upgrade to webpack@5? If not and if you are interested I could also invite you as a collaborator so that you can make the necessary change in a separate release branch.

thasmo commented 3 years ago

@bensampaio I totally understand your point of view. We're in the process of evaluating and upgrading webpack to version 5, but due to various dependent factors we don't be able to upgrade to webpack 5 shortly. If it's okay for you, feel free to create a separate branch and assign the relevant permissions to me, so I'm able to make the neccessary changes. Publishing releases for that branch on npm would probably still be on your side, I guess. Thanks a lot!

bensampaio commented 3 years ago

@thasmo I invited you as a collaborator and created branch 6.0. You can branch out from that branch and create a PR with the changes for me to review. I will then publish the release.

thasmo commented 3 years ago

@bensampaio, thanks! Going to have a look at it soon.

thasmo commented 3 years ago

@bensampaio I was able to test 6.0.2 on a project of ours and so far everything looks good. 👍 Thanks for the time, help and cooperation. 🙇‍♂️