original .styl files in .../node/ directory
wish to compile .css to .../nginx/ directory
app.use( stylus.middleware({
src: __dirname + '/node/www',
dest: __dirname + '/node/www',
//=src: req.basepath,
//=dest: req.basepath,
compile: function(str, path) {
return stylus(str)
.set('filename', path)
.set('compress', true)
.use(nib());
}
}) );
if I change dest: __dirname + '/node/www', to dest: __dirname + '/nginx/www' it bombs
don't quite understand how this is supposed to work
solved: was compiling ok. in express, stylus compiles in one step and then is served as a static file in a second step. this is different than jade, which is compiled and served in the same step - therein lay my confusion.
so using stylus in express, need to set the correct directory in the static step if stylus is compiling to a different directory.