如何从 .NET 编译 CoffeeScript?

How can I compile CoffeeScript from .NET?(如何从 .NET 编译 CoffeeScript?)

本文介绍了如何从 .NET 编译 CoffeeScript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个 HttpHandler,它可以即时编译 CoffeeScript 代码并发送生成的 JavaScript 代码.我尝试过 MS [JScript][1] 和 IronJS,但没有成功.我不想使用 [Rhino][2],因为 Java 依赖项会使其难以分发.

I want to write an HttpHandler that compiles CoffeeScript code on-the-fly and sends the resulting JavaScript code. I have tried MS [JScript][1] and IronJS without success. I don't want to use [Rhino][2] because the Java dependency would make it too difficult to distribute.

如何从 .NET 编译 CoffeeScript?

How can CoffeeScript be compiled from .NET?

推荐答案

CoffeeScript-dotnet

用于编译 CoffeeScript 的命令行工具.包括一个文件系统观察器,用于在 CoffeeScripts 更改时自动重新编译它们.大致相当于linux/mac的coffee-script节点包.

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.

CoffeeSharp

包括一个类似于 CoffeeScript-dotnet 的命令行工具以及一个 http 处理程序,当从 asp.net 站点请求时编译 CoffeeScripts.

Includes a command line tool similar to CoffeeScript-dotnet as well as a http handler that compiles CoffeeScripts when requested from an asp.net site.

SassAndCoffeeScript

Asp.net mvc 库,可根据要求编译 sass 和 coffeescript 文件.还支持缩小和合并.

Library for Asp.net mvc that compiles sass and coffeescript files on request. Also supports minification and combination.

使用 IronJS 手动编译

IronJS 是一个 .NET javascript 解释器,可以成功加载 CoffeeScript 编译器并编译 CoffeeScript.

IronJS is a .NET javascript interpreter that can successfully load the CoffeeScript compiler and compile CoffeeScript.

使用 Node.js 手动编译

获取 节点二进制文件并将 bin 目录添加到您的路径.编写一个 node.js 脚本来加载 CoffeeScript 编译器和你的 CoffeeScript 文件并保存编译好的javascript.

Get the node binaries and add the bin directory to your path. Write a node.js script to load the CoffeeScript compiler and your CoffeeScript files and save the compiled javascript.

这篇关于如何从 .NET 编译 CoffeeScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何从 .NET 编译 CoffeeScript?

基础教程推荐