I'm building a JS widget using Coffeescript. I'm playing some tricks to get my CSS/SCSS and HTML/HAML templates into the JS widget upon compilation:
# widget.js.coffee.erb
class Widget
constructor: (options) ->
@template = <%= Haml::Engine.new(
File.read(
File.expand_path("../../templates/widget.html.haml", __FILE__))).
render.to_json %>
@css = <%= Sass.compile_file(
File.expand_path("../../stylesheets/widget.css.scss", __FILE__)).
to_json %>
The problem is that when I change the HTML or CSS, Rails is not recompiling the Coffeescript in development because the coffeescript file is not changing. I need to make silly whitespace changes to force it to recompile things. This is getting annoying :-)
Any ideas on how to force the asset pipeline to compile certain files on every request?