coffee util when require(./module) takes .js file instead of .coffee

Problem

I use CoffeeScript 1.6.3. While developing, I just run with coffee myapp.

I also run coffee -c . to examine resulted .js files.

However, when running coffee myapp again, coffee util for require(./module) takes .js file instead of .coffee. While usually latest code version is in .coffee files.

Is it bug of coffe 1.6.3 util or there is some option to change that behavior?

Problem courtesy of: Paul Verest

Solution

What I usually do is run coffee --watch on my source tree, so whenever a .coffee file changes I immediately get it's .js counterpart.

Your imports will work fine, and you'll always have the latest .js from the latest .coffee as well.

Solution courtesy of: Nitzan Shaked

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.