Questions tagged [less-loader]
59 questions
0
votes
1 answer
How to fix a broken vuejs project after adding "less" and "less-loader" module
I had recently created a simple vuejs project using IntelliJ and wanted to start using less with it. But after running "npm install -D less less-loader" I'm getting an error and I'm unable to untangle it. I tried downgrading both webpack and the…

vector
- 7,334
- 8
- 52
- 80
0
votes
1 answer
Can't install less-loader in VueCLI3 project
Some pages of my project use less to render,so I run the npm command to install less and less-loader but find just less can successfully installed,for unknown reason, the less-loader keep falied to install and throw error like this:
PS…

Tracker647
- 29
- 6
0
votes
1 answer
webpack in production loads old cached less files instead of new server less
I am uploading my ReactJS/less/webpack site to the remote server for the first time, but the only problem is that webpack in production seems to be caching an old version of my less styles. I can definitely see in the cPanel file directory that the…

ApolloXI
- 9
- 3
0
votes
1 answer
How can I use a common base path to import from with a generic less webpack setup?
I am using a web stack of typescript+react and less together with webpack.
My webpack ruleset for less files looks like the following:
rules: [
{
test: /\.less/,
use: [
"style-loader",
"css-loader",
"less-loader",
…

Sossenbinder
- 4,852
- 5
- 35
- 78
0
votes
1 answer
I am adding LESS and CSS loader together for both the file types. Is this an overhead for webpack?
Here is the webpack.config.js
module: {
rules: [
{
// LESS-CSS Loader
test: /\.(le|c)ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
…

Nishant
- 1,034
- 9
- 19
0
votes
1 answer
Pre-processing LESS before less-loader in Webpack
I need to be able to apply some pre-processing (a string replace) to .less files that are pulled in for compile, but before the less-loader applies its own processing.
Initially I thought I could do:
test: /\.less/, include: /SomeDir/, use:…

Dan
- 1,130
- 2
- 20
- 38
0
votes
1 answer
less-loader ignores empty rulesets
I'm using less-loader to load less into css.
Then I use typings-for-css-modules-loader to get class name constants in TypeScript.
The problem is that I develop raw markup at first. During developing of mark-up I create empty rulesets in LESS to get…

Orchidoris
- 188
- 7
0
votes
1 answer
share less files in components architecture
I have 2 less files that I want them to be globals:
functions.less - where functions are declared
ex:
f_transition(@transString: 0) when not (@transString = 0) {
transition: @transString;
-moz-transition: @transString; /* Firefox 4 */
…

IsraGab
- 4,819
- 3
- 27
- 46
0
votes
1 answer
less-loader parse version number in globalVars wrongly
I'm using webpack 1.12.2, with less-loader version 2.2.3, and less 2.7.3 (i've got some issues that prevent me from upgrading...).
Anyway, i'm trying to add a glovalVars parameter for adding version number to urls (for some cache system).
but when i…

drizzt13
- 630
- 6
- 15
0
votes
0 answers
Webpack LESS-Loader, Keep LESS Variable unchanged
I am using Webpack 3 with LESS-loader. I know LESS-Loader compiles the less file to CSS file. But As I am new to Webpack, I don't know how can I keep the LESS variable as it is and later modify it with JavaScript.
I had used ModifyVar and passed it…

Rajiv Pingale
- 995
- 9
- 27
0
votes
0 answers
Prevent repeating parsing of less imports in css modules
I am using css modules together with less preprocessor using webpack.
Each of my css modules starts with
@import (reference) '~lib.less';
to load global variables and mixins.
The (reference) import option prevents any code from lib.less to be…

Martin Kadlec
- 4,702
- 2
- 20
- 33
0
votes
1 answer
Use LESS stylesheets in VS2017 Angular 5 project
I believe it should be easier than it looks. I'm new to webpack and I spent hours trying to figure out what I'm missing.
All I need is to add LESS preprocessor to webpack.config.js. Rule for CSS is already there and it works:
module: {
…

Ivan Zverev
- 327
- 2
- 14
0
votes
0 answers
Error loading less module in react
When I try to import a .less from my React component I get the following error:
Module not found: '[object Object]' in /path/to/src
Here's a part of my webpack config that's taking care of css and less loading:
...
{
test: /\.css$/,
loader:…

vijay
- 324
- 1
- 4
- 11
0
votes
1 answer
Webpack: How to merge css and less, THEN apply cssnano
I managed to compile my css and less resources („imported“ from javascript) to all-my-LESS|CSS, extract them using ExtractTextPlugin and merge them together with MergeFilesPlugin to combinedStyles.css.
The bit I am missing: How to run cssnano (e.g.…

Frank N
- 9,625
- 4
- 80
- 110