is there a coffeescript auto compile / file watcher for windows?

前端 未结 9 2192
攒了一身酷
攒了一身酷 2021-02-19 16:01

I\'d like to play around with integrating coffeescript into my dev process. But as I see it, I\'ll have to make a bat file that iterates a set of coffee files and spits out js f

相关标签:
9条回答
  • 2021-02-19 16:38

    See update at bottom of post.

    I was hunting for the same thing the other day and came across this: https://github.com/danenania/CoffeePy

    It's a simple python script that uses PyV8 to run coffee-script.js.

    It doesn't do anything fancy, just watches a folder recursively, and compiles any .coffee files whenever they're changed. It doesn't even have a bare option. These things could be very easily added though!

    Edit:

    I forked the script and added --bare and --output options.

    You can get it here: https://github.com/johtso/CoffeePy

    0 讨论(0)
  • 2021-02-19 16:49

    CoffeeScript-dotnet does what you want, but it is a command line tool.

    Command line tool for compiling CoffeeScript. Includes a file system watcher to automatically recompile CoffeeScripts when they change. Roughly equivalent to the coffee-script node package for linux / mac.

    0 讨论(0)
  • 2021-02-19 16:51
    coffee --watch -o lib -c src
    

    where src is a directory containing your coffee files, and lib is your JavaScript output directory.

    0 讨论(0)
  • 2021-02-19 16:54

    Another possibility: WebStorm 6. They've added a built in file-watcher for a variety of next-gen languages like SASS and Coffescript.

    0 讨论(0)
  • 2021-02-19 16:54

    If you want a different way of doing it, this might help: http://jashkenas.github.com/coffee-script/#scripts

    If you include the coffeescript compiler on your page, you can include files with a "text/coffeescript" type and they will get compiled client-side.

    Word of warning: Obviously, client-side compilation is not for something serious, but its completely fine for a small project/quick development. It would then be trivial to compile them on the server and change the MIME-type and filename when something a bit quicker is necessary.

    0 讨论(0)
  • 2021-02-19 16:55

    Mindscape Workbench has a built in compiler/editor for VS 2010. Haven't tried it yet, but it looks like it'd be even better than a watcher/compiler. Scott Hanselman has a post about it here:

    http://www.hanselman.com/blog/CoffeeScriptSassAndLESSSupportForVisualStudioAndASPNETWithTheMindscapeWebWorkbench.aspx

    0 讨论(0)
提交回复
热议问题