less does not handle relative paths when used with express.js
Using less as an compiler will break with relative import statements in .less files, see: http://stackoverflow.com/questions/4618257/node-js-express-js-how-to-render-less-css/4635200#4635200
+1, this is pretty annoying
Still annoying.
I have this issue too, can you make a fix?
css/ b/b.less common/functions.less
b.less: @import "../common/functions.less";
css> lessc b/b.less css> file '../common/functions.less' wasn't found.
I use less.js on the development side, but when on prodution i use the compiled files. Any update on this?
Thx and congratz on the great work so far!
Still here I see, but is this a less.js problem or an Express thing...?
less problem, i dont use Express.
above, this is resovled by current master branch, please replace your npm install less version, directly use less master branch. it's work for me. nodejs 6.1
eager to see this work
Great, thx a lot, ill test it.
Express does not complies my less styles
app.configure(function(){ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.methodOverride()); app.use({ src: __dirname + '/public' }); app.use(app.router); app.use(express.compiler({ src: __dirname + '/public/stylo', enable: ['less'] })); app.use(express.static(__dirname + '/public')); });
@ricardovf is that working ?
@anandrc have you tried setting src: __dirname + '/public' instead?
I have less 1.3.0, and my compiler is set to:
app.use(express.compiler({ src: __dirname + '/public', enable: ['less']}));
To make the imports work, I cannot use relative urls, I have to change them all to the following to make it work:
@import "/public/stylesheets/dashboard.less";
@import "/public/stylesheets/super_bar.less";
Otherwise it will just state [Object object] in the css.
Is there no fix for this?
using #331 as the central issue for this, closing as duplicate