require('zappajs') ->wrap = require 'asset-wrap'assets = new wrap.Assets [new wrap.Snockets {src: 'src/app.coffee'dst: '/app.js'}], (err) ->throw err if err@use assets.middleware@get '/': ->@render index: {assets: assets}@view index: ->head ->text @assets.tag '/app.js'body ->a href: @assets.url '/app.js', ->'View Javascript'
Hello,
> Instead of stuffing all my coffeescript in an inline string,
One option is to not stuff it in a string but to keep it in a function,
this
@coffee '/app.js': ->
($ 'body').html 'hello'
should work.
I guess this
@coffee '/app.js': require './app.coffee'
should work as well (as long as app.coffee `exports` the desired code and
sticks to what is doable client-side).
But have a look at the example for connect-assets,
https://github.com/zappajs/zappajs/blob/master/examples/connect-assets.coffee
which references .coffee files in
https://github.com/zappajs/zappajs/tree/master/examples/public/js
but serves them as .js (which is closest to what you wanted I presume).
I seem to remember @scien mentioned he's now using something better than
connect-assets but I can't remember the name.
S.
--
St�phane Alnet -- Telecom Artisan. OpenSource Advocate.