我正在尝试让 node-sass 与 express 一起工作,但我根本无法让它进行任何编译。这是我的 app.js 文件:
var express = require('express')
, sass = require('node-sass')
, routes = require('./routes')
, user = require('./routes/user')
, http = require('http')
, path = require('path');
var app = express();
app.configure(function(){
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(sass.middleware({
src: __dirname + '/public/sass',
dest: __dirname + '/public/stylesheets',
debug: true
}));
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser('your secret here'));
app.use(express.session());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
});
app.configure('development', function(){
app.use(express.errorHandler());
});
app.get('/', routes.index);
app.get('/users', user.list);
http.createServer(app).listen(app.get('port'), function(){
console.log("Express server listening on port " + app.get('port'));
});
我有public/sass
and public/stylesheets
,但无论.scss
我在 sass 目录中放置什么文件,都没有编译任何文件。还有什么我需要超越的node app.js
吗?
我真的快要放弃了,只需安装 sass gem 并保持一个额外的选项卡打开以查看目录。