ruby-on-railsasset-pipelinesprockets

rails 7 with sprockets, enable origin file in compiled css in development


I just started a new rails 7 project with --css bootstrap, but I'm finding that starting the server with bin/dev the compiled css does no longer (as in previous rails versions) output a comment with the file name and line number of the file where to find each scss class definition.

I'm actually rather confused on how the new rails works with scss and css, it doesn't seem that the css is compiled at all. I couldn't find any good resources for understanding how it works. any suggestions?

Thanks,


Solution

  • Sprockets doesn't seem to generate sourcemaps by default. You can try opening up this file: config/environments/development.rb

    And adding the line: config.assets.debug = true