Could we add the ability for the module to create source maps we can map too for ease of debugging?

http://code.tutsplus.com/tutorials/working-with-less-and-the-chrome-devt...

Comments

Ghostthinker’s picture

see https://drupal.org/comment/8687887#comment-8687887 for a solution, but it requires lessjs/node to be installed

corey.aufang’s picture

As far as I'm aware, source maps are not available currently with leafo/lessphp, which is the current compiler this module is built around.

Source maps will be available when the following tickets land:

  1. #2221237: Add oyejorge/less.php as default compiler
  2. #2003628: Add ability to use node.js version of LESS

  • Commit 94c1a48 on 7.x-3.x by corey.aufang:
    Issue #2203549 by corey.aufang: Adding in source maps support.
    Issue #...
corey.aufang’s picture

I have source map support mostly funcitonal.

"less.js" version I think is completely functional.

To ensure that source maps work even with files added through import paths, the entire source .less file has to be embedded in the source map.

This is going to drastically inflate the size of compiled files when in development mode.

For "oyejorge/less.php" there are two issues that are blocking:

https://github.com/oyejorge/less.php/issues/127
https://github.com/oyejorge/less.php/issues/128

  • Commit 8677b00 on 7.x-3.x by corey.aufang:
    Issue #2003628 by corey.aufang: lessjs is now run through a class....

  • Commit 94c1a48 on 7.x-3.x, 7.x-4.x by corey.aufang:
    Issue #2203549 by corey.aufang: Adding in source maps support.
    Issue #...
  • Commit 8677b00 on 7.x-3.x, 7.x-4.x by corey.aufang:
    Issue #2003628 by corey.aufang: lessjs is now run through a class....
corey.aufang’s picture

Version: 7.x-3.x-dev » 7.x-4.x-dev
Status: Active » Needs review

Got this working without needing the full source file to be added.

Any feedback would be appreciated.

ckng’s picture

Source mapping for oyejorge/less.php

- latest master branch is working correctly
- 1.7.0.2 not working as reported in #2203549-2: Source Map support

corey.aufang’s picture

Please try the latest 7.x-4.x-dev.

There have been many changes that should help reduce inconsistencies between engines, including support for source maps.

corey.aufang’s picture

Status: Needs review » Fixed

Marking this as fixed as 7.x-4.0 will be released soon.

If you are having any issues with source maps in 7.x-4.x prior to the release of 7.x-4.0, please re-open this ticket.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.