Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Client Side Dependency Management in CoffeeScript

What is the best way to do Dependency Management amongst CoffeeScript files if the resulting javascript files eventually need to be concatenated together for use on the client side?

For server side CoffeeScript I can just use the 'require' keyword to require other pieces of javascript. When this is compiled for client side apps to have the dependency tree, based on the requires, calculated and a concatenated stand alone javascript file produced. Is there anyway to do this in a generic way?

like image 311
Douglas Sellers Avatar asked Nov 10 '10 19:11

Douglas Sellers


People also ask

What is CoffeeScript used for?

CoffeeScript is a programming language that compiles to JavaScript. It adds syntactic sugar inspired by Ruby, Python, and Haskell in an effort to enhance JavaScript's brevity and readability. Specific additional features include list comprehension and destructuring assignment.

How do I use CoffeeScript in HTML?

You simple need to add a <script type="text/coffeescript" src="app. coffee"></script> to execute coffee script code in an HTML file. In other cases, I've seen people use the attributes of type="coffeescript" and type="coffee" , so they might work for you as well. Save this answer.


1 Answers

Another option is to use CoffeeToaster, which uses another approach than implementing AMD / CJS module patterns.

Take a look: http://github.com/serpentem/coffee-toaster

like image 185
Anderson Arboleya Avatar answered Oct 13 '22 01:10

Anderson Arboleya