Coder Social home page Coder Social logo

Comments (6)

jrief avatar jrief commented on July 22, 2024

In the generated sourcemap file, does libsass use / or \ in paths?
If it's a normal slash /, then this problem could be solved by replacing the first line against

components = os.path.normpath(srcfilename).split('/')

Please check, since I have no Windows machine to test.

from django-sass-processor.

frostbtn avatar frostbtn commented on July 22, 2024

libsass generates this:

	"sources": [
		"d:/Projects/py/project/scss/static/project.scss",
		"d:/Projects/py/project/scss/_bootstrap-custom.scss", 

Ok, first line could be changed. What about that first os.path.sep on the second line. It's what makes path invalid on Windows.

Generally, what libsass generates in the source map is already ok to check with os.path.* (down the code). Is libsass generates something strange on Linux? Some relative paths? Could you give an example, should you happen to have a minute for this. I may come up with a fix, I just can't figure out what problem unknown to me is being worked around in these lines.

(libsass's source map is pretty useless with this kind of paths on Windows, as Chrome tries to open something like https://server/d:/Projects/py/project/scss/static/project.scss and this can never be correct. It's a libsass problem for sure, but nobody care, me included. However, 1.5 seconds per page request is a problem, I suppose).

from django-sass-processor.

jrief avatar jrief commented on July 22, 2024

My development environment ist MacOSX, and there libsass creates entries such as

...
"sources": [
    "../../../Users/jrief/Workspace/djangoSHOP/django-shop/example/myshop/static/myshop/css/default.scss",
    "../../../Users/jrief/Workspace/djangoSHOP/django-shop/shop/static/shop/css/_django-shop.scss",
    "../../../Users/jrief/Workspace/djangoSHOP/django-shop/shop/static/shop/css/_variables.scss",
    ...
],
...

That's btw. the reason why I have to remove the ../../.. in front of /Users/. os.path.abspath() unfortunately doesn't work here.

from django-sass-processor.

frostbtn avatar frostbtn commented on July 22, 2024

Oh, I see. That's make sense now. A total mess on libsass's end.
I shall take a deeper look, if the time will allow.
Let's leave this issue open for the time, maybe someone may have more input.

from django-sass-processor.

jrief avatar jrief commented on July 22, 2024

@frostbtn have you been able to find a fix on Windows?

from django-sass-processor.

frostbtn avatar frostbtn commented on July 22, 2024

I found no easy and safe way to fix it, unfortunately. I don't think I will have more input on this issue in the nearest future.

from django-sass-processor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.