1

How can I make this work?

This is my jade file:

!!!
html
head
    title= title
    link(rel='stylesheet', href='/stylesheets/style.css')
    sript(type='text/javascript', src='/javascripts/script.coffee')

I don't want to use any JavaScript in my project, so I'm using node-dev to run app.coffee instead of app.js for server. It works just fine for server-side coffee-files, but not for client-side.

I need some kind of render engine that could compile coffee-files on a fly, like stylus middleware:

app.use require('stylus').middleware(__dirname + '/public')
app.use express.static path.join __dirname, 'public'

2 Answers 2

2

There are several you might check out:

Personally I really like Browserify, as you can write your client-side CoffeeScript using the CommonJS module.exports style, but I've been meaning to check out webpack, which looks promising.

Sign up to request clarification or add additional context in comments.

Comments

0

Check out https://github.com/wdavidw/node-connect-coffee-script

I'd question the performance of any client side compilation for production apps.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.