TrevorBurnham/connect-assets — Issue #73: preprocessor
Author: rlidwka
Created: 2012-02-19 18:22:11+00:00
State: open

I have some javascript files and a bunch of html templates. And I want all this files to be send to client as one single file.

For example, I want to write something like that:

test.haml:

```haml
.test_div
```

test.coffee:

```coffeescript
div = '
#include test.haml
'

# and now use it somewhere
$('.smth').html(div);
```

And get this as a result:

```javascript
(function() {
var div;

div = '\

\
';

$('.smth').html(div);

}).call(this);
```

How can i do that? As far as I know, #=require is only for including another script files, and it works very different.

Of course, I'm talking about compiling it on the fly with connect-assets. I would use jspp or something like that, but it adds another level of complexity here.