0

I have a less file in my project which includes other less files with @import statements.

Currently the file is compiled to css with webpack.

What I want is to compile this file to css in the browser.

When I set the less loader to a file loader for this file, I get a less file but the imports are not resolved.

When I set the less loader for this file, I get a css file.

How can I achieve this?

DilbertFan
  • 113
  • 1
  • 1
  • 9
C Taque
  • 997
  • 2
  • 15
  • 31
  • `What I want is to compile this file to css in the browser.` really? What issue are you trying to solve? – Kyll Mar 21 '19 at 09:36
  • We want to modify less vars in the browser, we have 90+ websites using same skeleton, only theme changes – C Taque Mar 21 '19 at 09:41
  • 1
    I see. You may be suffering from an [XY problem](https://meta.stackexchange.com/q/66377/306392). You may want to ask about your _issue_ rather than this attempted solution. I don't know much (if anything) about Less and CSS, but you may be interested in [this question](https://stackoverflow.com/q/10554462/4174897) as well. – Kyll Mar 21 '19 at 09:46
  • "An XY problem seems to be a subset of the Einstellung effect, where a problem-solver gets stuck on a particular solution and is unable to backtrack mentally to see potentially superior solutions. This psychological phenomenon affects everyone, novices and experts alike." This is very interesting – C Taque Mar 21 '19 at 09:57
  • I am half sorry, half happy I completely sent you off-track from your problem ^-^ – Kyll Mar 21 '19 at 10:31
  • Unless you have to support IE, and it's LESS files you're in control of, maybe look at switching to native CSS and use custom properties/variables: https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties#Basic_usage – Joe the Coder Apr 29 '19 at 15:49

0 Answers0