Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

less does not handle relative paths when used with express.js #177

Closed
BonsaiDen opened this issue Jan 8, 2011 · 14 comments
Closed

less does not handle relative paths when used with express.js #177

BonsaiDen opened this issue Jan 8, 2011 · 14 comments

Comments

@BonsaiDen
Copy link

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

@andrew
Copy link

andrew commented Aug 19, 2011

+1, this is pretty annoying

@ricardobeat
Copy link
Contributor

Still annoying.

@ricardovf
Copy link

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!

@awhillas
Copy link

Still here I see, but is this a less.js problem or an Express thing...?

@ricardovf
Copy link

less problem, i dont use Express.

@xiaods
Copy link

xiaods commented Nov 14, 2011

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

@samdelagarza
Copy link

eager to see this work

@ricardovf
Copy link

Great, thx a lot, ill test it.

@anandof28
Copy link

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'));
});

@anandof28
Copy link

@ricardovf is that working ?

@ricardobeat
Copy link
Contributor

@anandrc have you tried setting src: __dirname + '/public' instead?

@mohamedmansour
Copy link

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.

@neonstalwart neonstalwart mentioned this issue May 15, 2012
@mhuggins
Copy link

mhuggins commented Jun 2, 2012

Is there no fix for this?

@lukeapage
Copy link
Member

using #331 as the central issue for this, closing as duplicate

strk pushed a commit to CartoDB/carto that referenced this issue Nov 2, 2012
Include the instance name in the rule id (fixes less#177)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests