next-with-less
next-with-less copied to clipboard
Fix error when resolving relative url(...) inside node_modules
I caught an error since upgrading to next@12
relative url(...)
inside node_modules is resolved incorrectly
Examples:
-
url(../fonts/glyphicons-halflings-regular.eot)
=>url(../node_modules/bootstrap/node_modules/bootstrap/fonts/glyphicons-halflings-regular.eot)
-
url(./ajax-loader.gif)
=>url(../node_modules/slick-carousel/node_modules/slick-carousel/slick/ajax-loader.gif)
This PR fix above issue, I tested it with the repo's examples and it runs fine
Can you see if this also happens in CSS/SCSS files in Next.js? If so I believe this is a Next.js bug. I don't think this is this plugin's responsibility to own url()
resolving.