Mark Murphy
Mark Murphy

Reputation: 2874

Ruby on Rails Less source maps and the asset pipeline?

I'm currently using the less-rails gem in a Ruby on Rails application that I'm building. I would like some way to debug my Less css files in Chrome by way of source maps (https://developers.google.com/chrome-developer-tools/docs/css-preprocessors) Does anyone know how this can be accomplished?

Upvotes: 13

Views: 505

Answers (2)

hazg
hazg

Reputation: 358

In my opinion, the most convenient way to solve the problem: to abandon the assets pipeline and less-rails. change to gulp or blendid with gulp-less+gulp-less-sourcemap. This will take time to configure, but as my practice shows, the loss of time more than pays off with features like life edit, very fast compilation, and of course - sourcemaps.

In fact, I personally did not use less in such a bundle, but the implementation of sass is very convenient. I think that with less it could be the same

Upvotes: -1

user907998
user907998

Reputation: 15

You can use pry to debug in rails. So, whereever you are using your css in the haml or html you can write something like -binding.pry( if its haml). Pry is used for debugging ruby code but you can also use it in your haml(view) using -.

https://github.com/pry/pry

Hope this helps.

Upvotes: -3

Related Questions