question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Imported less files are not being prefixed

See original GitHub issue

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

13reactions
badsyntaxcommented, Oct 21, 2015

@avindra @Dakuan

It’s been a while since I’ve used webpack and i’d be damned if I knew the point of these loaders anymore. I hate you so much webpack.

css-loader expects CSS code, there’s nothing more to it than that. pass in your final compiled CSS into css-loader.

I guess the output of css-loader is not a stream of CSS, thus you can’t pipe that ouput into postcss-loader.

  • style-loader|css-loader is the way to do it just with css
  • style-loader|css-loader|postcss-loader is the way to post-process css
  • style-loader|css-loader|less-loader is the way to do it if you want to use less
  • style-loader|css-loader|postcss-loader|less-loader is the way to post-process the compiled less (css)
1reaction
badsyntaxcommented, Jun 2, 2015

As I understand it, you need to pipe the output of the compiled css into the css-loader. Thus, this should be the correct order:

ExtractTextPlugin.extract("style-loader", "css-loader!postcss-loader!less-loader")

…which results in:

.foo {
  background-color: red;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
}
.bar {
  background-color: yellow;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing Font-Awesome.less variables in my .less file after ...
I got an interesting parse error in my project. I use Font Awesome and I imported it into my app.less file. (I use...
Read more >
Prefix partial LESS source files with underscore #4907 - GitHub
I use Web Essentials in my .Net projects, however by default, when compiling it will generate css files for each less file in...
Read more >
Less - Prepros
Less (which stands for Leaner Style Sheets) is an extension of CSS that enables you to use things like variables, nested rules, inline...
Read more >
Introducing Sass Modules - CSS-Tricks
Import files with @use · The file is only imported once, no matter how many times you @use it in a project. ·...
Read more >
Sass: @import
Sass extends CSS's @import rule with the ability to import Sass and CSS stylesheets, providing access to mixins, functions, and variables and combining ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found