emberfeather / less.js-middleware

Connect Middleware for LESS.js compiling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Less Middleware with Express

CrackerakiUA opened this issue · comments

I am trying to setup less on my nodejs project and when i request my page from browser less-middleware debug show me wrong path and dest path. When i ask for example '/public/css/index.css' from my webpage i adds '/public/css/' to the source path. Below are mine configures:

app.use(lessMiddleware(__dirname+'/server/less',{
    debug: true,
    dest: __dirname+'/public/css',
    once: true
}));

And debug screen shows:

pathname : /public/css/index.css
source : D\Work\project\server\less\public\css\index.less
destination : D\Work\project\public\css\public\css\index.css

Even if i fix the destination path, i am having problem with source and i dont want to put my less files into public folder. Is there a way of remove that /public/css from compiled less.
I have tried to add:

'preprocess.path': function(pathname, req){
    console.log(pathname);
}

but console.log never shows. Also perhaps there is a way to not compile every css file users ask and just compile those less files which i have in less folder.

P.S. every module i am using is under "*" version.

There is an example of modifying the path in the example wiki page that handles this case.