You need to use the sass middleware, for example this one.
Quoting from docs:
var server = connect.createServer(
sass.middleware({
src: __dirname
, dest: __dirname + '/public'
, debug: true
}),
connect.static(__dirname + '/public')
);
in case of using express, just add:
app.use(
sass.middleware({
src: __dirname + '/sass', //where the sass files are
dest: __dirname + '/public', //where css should go
debug: true // obvious
})
);
to your app.configure()
call.
Of course on production systems it's a better idea to precompile sass to css.
update
In the example above the middleware will look for sass
files in __dirname + '/sass/css'
. Also by default it looks for files with .scss
extension. There doesn't seem to be an option to change the extension.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…