Rails 3.1 asset pipeline doesn't pick up changes to @import'd sheets

后端 未结 2 2093
谎友^
谎友^ 2021-02-01 06:51

I use @import\'d partial sheets to organize my css/sass:

/app
  /assets
    /stylesheets
      _constants.sass
      _layout.sass
      ...
      ap         


        
2条回答
  •  滥情空心
    2021-02-01 06:56

    Using a depend_on directive may do what you require. This makes the given file a dependency of the base file (so the base file is regenerated when the dependency changes), but doesn't include it in the bundle.

    For example:

    /*
    *= depend_on _layout.sass
    *= depend_on _constants.sass
    */
    @import _layout.sass
    @import _constants.sass
    

    See this sass and sprockets blog post as well as the sprockets documentation (especially the directives section).

提交回复
热议问题