-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
seperate sourcemaps are badly generated #41
Comments
I can confirm the 'sources' entries are bad. On windows servers it also includes the drive letter. HOWEVER, the correct entry should only be the relative path on the web server...so the example above a correct 'sources' entry would be 'less_php/theme.less'. The full path is supposed to be trimmed in the Generator->normalizeFilename() function, HOWEVER the passed filename is TOO full so that the sourceMapBasepath can't be found/replaced by the strpos/substr calls. |
Since the standard is for the sources to be a relative path, the real fix is to pass a 'sourceMapBaseName' of the root part of the path which when stripped from the full path by the parser will create a relative path. In your case the correct param passed should be:
The fix for my problem is to add the following lines to the Parser::AbsPath() function after the call to realpath()
|
@dleffler thank you for your reply, I hope that the maintainers will fix that soon |
My quick composer patch worked for me. Maybe does not address all issues.
|
Hello guys, this is my first use of less.php, so here is my exemple:
The web DocumentRoot is public_html/ , which includes these files :
index.php
theme.less
footer.less
header.less
components/buttons.less
The generated theme.css
The issue
the generated theme.map looks like this
The "sources" values shouldn't be absolute, because when using the navigator inspector, the navigator can't access to them.
The fix
vendor/wikimedia/less.php/lib/Less/SourceMap/Generator.php
I removed this block :
And I changed this line :
to become :
So the result of the new generated theme.map is :
And everything is ok in the navigator inspector 💯
Thank you for your help and suggestions 👍
The text was updated successfully, but these errors were encountered: