Skip to content
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

source-map support #135

Closed
edwinveldhuizen opened this issue Dec 17, 2013 · 24 comments
Closed

source-map support #135

edwinveldhuizen opened this issue Dec 17, 2013 · 24 comments
Labels

Comments

@edwinveldhuizen
Copy link
Contributor

There are currently two ways how you can debug sass quite easily:

  • use the option --line-numbers which parses the line-numbers of the original files as comments in the output
  • use the option --source-map with the pre-releases of sass which creates a source-map file next to the css so you can debug it really easily with Crome Dev Tools

As far as I know both of the above features aren't implemented in scssphp, but it would be a great addition! Now it's really hard to track where that rule was written.

@robocoder
Copy link
Collaborator

Can we close this as a duplicate of #88?

@edwinveldhuizen
Copy link
Contributor Author

Well in my opinion having source-maps is even better than line-numbers. Maybe I should have made it as a separate issue..

@robocoder robocoder changed the title Make finding rules easier by adding either line-number or source-map as an option source-map support Aug 8, 2014
@robocoder
Copy link
Collaborator

I changed the title and added the 3.3 label as it's a feature parity issue.

@flexphperia
Copy link

Having source maps will definitively make debugging easier for example by using it in Chrome developer tools window

@gerhard-boden
Copy link

I've forked this project and added the line number feature into the develop branch:
https://github.com/Screenchecker/scssphp/tree/develop#optional-output-scss-line-numbers

update June 2015:
Please consider using the branch line-numbers-v2 since it is the merged version of my fork and the newest version of scssphp.

@robocoder
Copy link
Collaborator

Branch: wip/source-maps
Status:

  • Base64 and Base64VLQ classes
  • Generator
  • MappingList ?
  • Util ?
  • bin/pscss
  • Compiler integration
  • Server integration

@robocoder
Copy link
Collaborator

(p.s. --line-numbers and --debug-info are available in the latest version of scssphp)

@acasar
Copy link

acasar commented Nov 27, 2015

@robocoder Any update on source maps? Or do you maybe know about any Chrome plugin that would work with --line-numbers?

Thanks a lot!

@robocoder
Copy link
Collaborator

@acasar Support for sourcemaps is a work-in-progress being juggled with other issues (eg selectors and scope). Sorry, I don't know of any Chrome plugins that support --line-numbers.

@smachi
Copy link

smachi commented Dec 4, 2015

+1 for this

@riverofjanuary
Copy link

Please please add sourcemaps - it is impossible to do live debug (remote) without it.

@wojtas
Copy link

wojtas commented Jan 8, 2016

@robocoder Could you share your current code for source maps' generation? I desperately need them, maybe I could pick up where you left and finish that feature?

@robocoder
Copy link
Collaborator

@wojtas: there's not much here: https://github.com/leafo/scssphp/tree/wip/source-maps

@nickleus
Copy link

+1 for source maps

1 similar comment
@CamilleBouliere
Copy link

+1 for source maps

@acasar
Copy link

acasar commented Feb 19, 2016

If anyone is interested - in my project I managed to quite easily extract line number comments to a real source map using this package: https://github.com/koala-framework/sourcemaps

@robocoder Maybe if we add it as a dependency it would be much easier to implement source maps natively?

@robocoder
Copy link
Collaborator

Feel free to submit a PR.

ahukkanen added a commit to peruskallio/c5_asset_pipeline that referenced this issue Mar 24, 2016
Removed one TODO from the README file:

Checked it is not currently possible to do source maps with leafo/scssphp.

More details:
leafo/scssphp#135
@SimonEast
Copy link

+1 for source-maps. Has been over a year since it being a WIP. Would love to see it eventuate, but not sure if it's likely any time soon?

@dstorozhuk
Copy link

dstorozhuk commented Feb 28, 2017

Here is my gist:
https://gist.github.com/dstorozhuk/e90e6b151129f5bb9d20e871e0137d38

The code extends the Leafo\ScssPhp\Server. The most important methods for generating maps is CssServer::compile() and CssServer::generateMap().

@s4msung
Copy link

s4msung commented May 3, 2017

+1 for source maps

@NicolaF
Copy link

NicolaF commented Nov 9, 2017

See #541 : inline sourceMap generation.

I did not add the command line switches nor detached source map, but the hardest part is done. And it works really well with https://github.com/NicolaF/autoprefixer-php. (See vladkens/autoprefixer-php#13)

@riverofjanuary
Copy link

@NicolaF, i'll go ahead and try that commit to see how it works. Any special config or it just "works"?

@NicolaF
Copy link

NicolaF commented Nov 9, 2017

@riverofjanuary It just works ;-)

$compiler->setSourceMap(Compiler::SOURCE_MAP_INLINE);
$compiler->setSourceMapOptions([
    'sourceMapBasepath' =>'<your root directory>'
    'sourceMapRootpath' => '<whatever url works for serving the original files so that your browser can display the sources>'
]

The option names are a bit misleading, but I kepts the names from oyejorge/less.php, for those of us who are transitioning to bootstrap 4 and used oyejorge/less.php with the less version of bootstrap 3.

@riverofjanuary
Copy link

Thanks. I see I cant actually pull that SHA because it hasn't been committed, but I'll wait to see what the dev does.

robocoder added a commit that referenced this issue Dec 14, 2017
See #135: add inline sourceMaps support
@ghost ghost mentioned this issue Jul 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests