Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Relative paths in url() are not resolved correctly for imported files with @import #29

Closed
ivosabev opened this issue Mar 17, 2016 · 3 comments

Comments

@ivosabev
Copy link

When you @import a CSS file the relative paths are resolved based on the file I am importing into not relative to the imported file.

File structure

/assets/background.png
/assets/Layout.css
/component/Header/Header.css

Header.css

@import '../../assets/Layout.css';

Layout.css

body {
  background: url(background.png);
}

This throws an error, because for some reason after the import the relative path is no more relative to Layout.css. Any ideas?

@michael-ciniawsky
Copy link
Member

@ivosabev Can you provide more info about your setup please (webpack.config.js) ?

@ivosabev
Copy link
Author

ivosabev commented Apr 9, 2017

Unfortunately this was quite some time ago and I don't have the same setup anymore. I guess you may close it since no one else had the same issue.

@michael-ciniawsky
Copy link
Member

Alright, we are planning to take a through look at css-loader/url-loader and friends to shape issues like that out in the future, but that's a abstract statement here. Sry for the delay and inconvience

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants