Compile CoffeeScript files into one js file ?

119 views
Skip to first unread message

Cyril N.

unread,
Jul 20, 2012, 8:28:30 AM7/20/12
to play-fr...@googlegroups.com
Hello!

I'd like to know if it's possible, using 2.0.2 (or trunk), to compile all my assets/*.coffee files into one, defined (say app.js & app.min.js) file, thus without using the native compiler ?

Thanks for your help! :)

Andrew Conner

unread,
Jul 20, 2012, 9:14:11 AM7/20/12
to play-fr...@googlegroups.com
Similar to the Clojure compiler, you can specify which files are compiled by setting your 'coffeeScriptEntryPoints' in your SBT settings in Build.scala.

For example, if you wanted to not include all files starting with an underscore, add:
    coffeescriptEntryPoints <<=(sourceDirectory in Compile)(base => ((base / "assets" ** "*.coffee") --- base / "assets" ** "_*")),

I'm not sure of an easy way to make Play! use a different CoffeeScript compiler though. You might need to do that manually unless someone has an elegant solution.

Reply all
Reply to author
Forward
0 new messages