Automatically generate CSS from SCSS / SASS using HAML and Rails

Is there a way to get your SCSS files to automatically generate new CSS every time a file changes as part of Rails, without having to use sass -watch? Or should it happen anyway?

By this, I mean that the rails are monitoring you, or maybe if he can recompile the entire load of each SCSS page in development, this is also good.

Also, perhaps HAML is not loading properly, as if I included the line:

Sass::Plugin.options[:always_update] = true

after my initialization block in environment.rb, when I start it I get the following exception:

/persistent/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant Sass (NameError)

I work with Rails v 2.3.5 and HAML v 3.0.18 and have "config.gem" haml ':: version =>' 3.0.18 '"in my initialization block.

Thank you for your help.

+3
2

config.gem "haml" Haml, Sass. - Haml? , ?

0

, , .

config.gem "haml"

, , , . , config.plugins = [], , "haml" . config.plugins, , .

0

Source: https://habr.com/ru/post/1762411/


All Articles