compiler middleware has no effect when destination directory != static directory #283

Closed
jameshfisher opened this Issue May 26, 2011 · 1 comment

3 participants

@jameshfisher

Simple app:

var connect = require('connect');
connect(
  connect.compiler({
    src: __dirname,
    dest: __dirname + '/static/css',
    enable: ['less']
  }),
  connect.static(__dirname + '/static')
).listen(3000);

Test case: GET /static/css/hw.css

Expected behavior: ./hw.less is compiled to `./static/css/hw.css', and then served. This is the case with other middlewares (Stylus for one) so I think this is the intended behavior.

Actual behavior: nothing is compiled, routing falls through, and 404 is served.

The expected behavior occurs when dest: __dirname + '/static', but not in the above example or any other non-static directory I've tried. The same bug occurs with the "sass" and "coffeescript" compilers.

@gotik

You dont need to specify /css,
I have the folder /stylus/css/ (Where .styl)
And /public/css/ (for the .css)
``` src: __dirname + '/stylus',
dest: __dirname + '/public',

Make sure the file you're render for example layour.jade contains
ink(rel='stylesheet', href='/css/style.css')

It works for me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment