wycats / rake-pipeline-web-filters

MIT License
116 stars 34 forks source link

Changes to @import[ed] files in SASS filter won't update server #31

Closed sandstrom closed 12 years ago

sandstrom commented 12 years ago

foo.scss

@import "bar";

_bar.scss

body { color: green; }

Steps to reproduce:

  1. add the files above
  2. run rakep server
  3. change _bar.scss
  4. reload website (without restarting the server)
  5. the change won't show (unless foo.scss is modified/touched too)
dudleyf commented 12 years ago

If _bar.scss isn't an input to the pipeline, rakep doesn't know that foo.scss depends on it. The Sass filter adds files from :additional_load_paths to the dependencies for each Sass file, so if you pass the directory containing _bar.scss into :additional_load_paths when you call the Sass filter, it should work:

# Assuming _bar.scss is in 'scss/_bar.scss'
scss :additional_load_paths => ['scss']
sandstrom commented 12 years ago

@dudleyf thanks! I added "." to the path and it worked. (though I could import them before which is strange, anyway it works now)

dudleyf commented 12 years ago

Yeah, if they're in the current directory, Sass's @import will find them, but the Sass filter won't add them to the dependencies. So in this case, passing in the :additional_load_paths is just a workaround to force the filter to notice the extra dependencies.