Open ericorruption opened 9 years ago
I've also run into this issue, the code looks like it has an option called opts.from
but I don't know how to pass that in to the postcss
CLI?
+1 Also having this problem
+1
I think this issue have been fixed in the new version 3.x, I changed the path resolve in the PR #39. Related code is here.
Resolved indeed.
Nope, sincerely not, now it uses the path from the source-file:
/ css
/ img
| image.png
/ src
/ scss
| style.scss
style.scss:
.foo {
background-image: url("../img/image.png");
}
Error: ENOENT: no such file or directory, open '/project/src/img/image.png'
@CinKon , your source file is located in src/scss
, and your built css is located in css
folder. And now the plugin resolved path is relative to the source file path, so there should have a img
folder under the src
folder. I know your situation, and I think you should use some assets rebase
plugins to handle this.
+1 如果地址是非本地地址会报错
Hello,
I'm having an issue with relative paths. In a SCSS partial i'm declaring a background-image as
url(../img/bg.jpg)
, however the plugin searches for this file at the root of the project (/Users/user/Sites/code/project-folder
), not relative to the stylesheet path (should be/Users/user/Sites/code/project-folder/src/css
- where my CSS is).Stack trace is as follows: