rmosolgo / react-rails-hot-loader

Live-reload React.js components with Ruby on Rails & react-rails
MIT License
88 stars 24 forks source link

Adding assets to the watch glob #3

Closed willcosgrove closed 9 years ago

willcosgrove commented 9 years ago

Currently, it doesn't look like it's possible to modify the glob string used to watch for assets. I've got a lot of files in my project that are *.coffee files, not *.js.coffee. I was able to modify the line

asset_glob = path.to_s + "/**/*.js*"

to

asset_glob = path.to_s + "/**/*.{js,coffee}*"

to get me up and running. I didn't know if you would want to merge in a change like that, or if you would prefer to add some kind of mechanism for configuring the asset glob path.

Either way, I'm up for sending a PR if you're interested in adding it.

Awesome gem by the way! This is going in all my projects.

rmosolgo commented 9 years ago

Yay, happy it works for you too! I think even at PCO I'm the only one who uses it.

I think it would be great to make it configurable. If it was me, I would:

I suppose a more Rails-y way would be to take config in the Railtie but ... Railties wear me out! Your call :P