bholloway / resolve-url-loader

Webpack loader that resolves relative paths in url() statements based on the original source file
563 stars 71 forks source link

resolve-url-loader tries to find http urls #66

Closed rdhaliwal closed 6 years ago

rdhaliwal commented 6 years ago

Hi there! Love your work 😄

One issue I encountered was that resolve-url-loader was trying to find 'http' urls in css. In our css, we have something like:

.HomeCTA-container {
  background-size: cover;
  background-image: url("https://res.cloudinary.com/yourgrocer/image/upload/c_scale,q_52,w_1920,f_auto/v1499829754/home/homepage-hero1_d7lj8c.jpg");
}

And I noticed that webpack was taking forever to compile. After debugging it a bit, it was scouring every folder trying to find this. While it ignored node_modules, we have a ruby app, so it was going through all the ruby gems we have installed. My workaround was to specify the 'root' as app/assets, so it gave up if it couldn't find it there.

I guess I'm raising this issue because I believe it should ignore http urls, and only try and follow relative paths/files.

I'm using:

"webpack": "^3.3.0",
"resolve-url-loader": "^2.1.0",
yarn 0.27.5
node 8.1.4
bholloway commented 6 years ago

@rdhaliwal sorry for the delay on this. Please refer to #68.

bholloway commented 6 years ago

Published as resolve-url-loader@2.1.1.

Please let me know if you have any problems @rdhaliwal and I will reopen.

rdhaliwal commented 6 years ago

No worries, thanks for the fix!