Closed paroxp closed 7 years ago
You need to tell libsass the absolute path to resolve include paths. You can check out these lines in the wellington project to see how I handle this: https://github.com/wellington/wellington/blob/master/wt/main.go#L217-L222
My guess is that go-libsass passes the relative paths onto libsass, but it has no code to expand these to absolute paths. os.Open
works because go
is expanding the relative lookup, but libsass doesn't know where to resolve these paths.
I setup a project like so:
main.go
scss/style.scss
scss/_variable.scss
go run main.go
worked as expected in this case so I couldn't reproduce your problem. Like you said, it might be a good idea to remove the other imports to make sure this is the issue.
If this doesn't solve the problem, isolating this into a full repo case would be helpful.
Thanks for the response.
It doesn't appear to solve the problem though :(
So, I've included the code responsible for converting paths into the absolutes here and then using it in my main file.
If you were going to run these, be sure to run npm install
as well :(
go run main.go config.go page.go utils.go
Thanks for including the code, it should be fixed in 70e55d4c8433334142a94120c8b3fbccd0a0af25
Thanks!
Hey!
I'm rewriting my
Webpack
/Gulp
compiler inGo
and I've run into an issue, when using theIncludePaths
functionality ofgo-libsass
.What
My
tree
looks like this:The
main.go
file, has the following code implemented:The
style.scss
file, is simple.And then, when I execute
go run main.go
, I get the following:Possibility
I suspect, that the
go-libsass
may have a problem, when (for example),susy
will contain it's ownvariables
file.I'm probably configuring something wrong, in which case it would be nice to see some documentation on this :)
Any feedback on this would be great.
Thanks!